erigon-pulse/cmd/rpcdaemon/commands/db_api_deprecated.go
Thomas Jay Rush 1bd46089e9
Start of re-working of RPC code to align with testing better (#1225)
* Starting process of rearranging RPC code

* First version of automated testing

* Putting RPC docs in their own folder

* Fixing build

* Making varible names more consistent

* Adding deprecated RPC commands for db_

* Adding deprecated RPC commands for shh_

* Adding deprecated RPC commands for eth_
2020-10-12 09:39:33 +01:00

47 lines
1.5 KiB
Go

package commands
import (
"context"
"fmt"
)
// DBAPI the interface for the db_ RPC commands (deprecated)
type DBAPI interface {
GetString(_ context.Context, _ string, _ string) (string, error)
PutString(_ context.Context, _ string, _ string, _ string) (string, error)
GetHex(_ context.Context, _ string, _ string) (string, error)
PutHex(_ context.Context, _ string, _ string, _ string) (string, error)
}
// DBAPIImpl data structure to store things needed for db_ commands
type DBAPIImpl struct {
unused uint64
}
// NewDBAPIImpl returns NetAPIImplImpl instance
func NewDBAPIImpl() *DBAPIImpl {
return &DBAPIImpl{
unused: uint64(0),
}
}
// GetString Returns string from the local database. (deprecated)
func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_getString")
}
// PutString Stores a string in the local database. (deprecated)
func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_putString")
}
// GetHex Returns binary data from the local database. (deprecated)
func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_getHex")
}
// PutHex Stores binary data in the local database. (deprecated)
func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_putHex")
}