erigon-pulse/cmd/rpcdaemon/commands/db_api_deprecated.go
Thomas Jay Rush 1af3e09d75
1209 automate documentation (#1290)
* Automate documentation

* Updating

* Updating

* Fixing lint

* Updating readthedocs documentation

* Updating testing

* Updating testing
2020-10-24 18:03:52 +01:00

53 lines
1.9 KiB
Go

package commands
import (
"context"
"fmt"
"github.com/ledgerwatch/turbo-geth/common/hexutil"
)
// 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) (bool, error)
GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error)
PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, 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 implements db_getString. Returns string from the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) GetString(_ context.Context, _ string, _ string) (string, error) {
return "", fmt.Errorf(NotAvailableDeprecated, "db_getString")
}
// PutString implements db_putString. Stores a string in the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) PutString(_ context.Context, _ string, _ string, _ string) (bool, error) {
return false, fmt.Errorf(NotAvailableDeprecated, "db_putString")
}
// GetHex implements db_getHex. Returns binary data from the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) GetHex(_ context.Context, _ string, _ string) (hexutil.Bytes, error) {
return hexutil.Bytes(""), fmt.Errorf(NotAvailableDeprecated, "db_getHex")
}
// PutHex implements db_putHex. Stores binary data in the local database.
// Deprecated: This function will be removed in the future.
func (api *DBAPIImpl) PutHex(_ context.Context, _ string, _ string, _ hexutil.Bytes) (bool, error) {
return false, fmt.Errorf(NotAvailableDeprecated, "db_putHex")
}