Documentation ¶
Index ¶
- type DatabaseClient
- func (db *DatabaseClient) Close() error
- func (db *DatabaseClient) Compact(start, limit []byte) error
- func (db *DatabaseClient) Delete(key []byte) error
- func (db *DatabaseClient) Get(key []byte) ([]byte, error)
- func (db *DatabaseClient) Has(key []byte) (bool, error)
- func (db *DatabaseClient) NewBatch() database.Batch
- func (db *DatabaseClient) NewIterator() database.Iterator
- func (db *DatabaseClient) NewIteratorWithPrefix(prefix []byte) database.Iterator
- func (db *DatabaseClient) NewIteratorWithStart(start []byte) database.Iterator
- func (db *DatabaseClient) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator
- func (db *DatabaseClient) Put(key, value []byte) error
- func (db *DatabaseClient) Stat(property string) (string, error)
- type DatabaseServer
- func (db *DatabaseServer) Close(_ context.Context, _ *rpcdbproto.CloseRequest) (*rpcdbproto.CloseResponse, error)
- func (db *DatabaseServer) Compact(_ context.Context, req *rpcdbproto.CompactRequest) (*rpcdbproto.CompactResponse, error)
- func (db *DatabaseServer) Delete(_ context.Context, req *rpcdbproto.DeleteRequest) (*rpcdbproto.DeleteResponse, error)
- func (db *DatabaseServer) Get(_ context.Context, req *rpcdbproto.GetRequest) (*rpcdbproto.GetResponse, error)
- func (db *DatabaseServer) Has(_ context.Context, req *rpcdbproto.HasRequest) (*rpcdbproto.HasResponse, error)
- func (db *DatabaseServer) IteratorError(_ context.Context, req *rpcdbproto.IteratorErrorRequest) (*rpcdbproto.IteratorErrorResponse, error)
- func (db *DatabaseServer) IteratorNext(_ context.Context, req *rpcdbproto.IteratorNextRequest) (*rpcdbproto.IteratorNextResponse, error)
- func (db *DatabaseServer) IteratorRelease(_ context.Context, req *rpcdbproto.IteratorReleaseRequest) (*rpcdbproto.IteratorReleaseResponse, error)
- func (db *DatabaseServer) NewIteratorWithStartAndPrefix(_ context.Context, req *rpcdbproto.NewIteratorWithStartAndPrefixRequest) (*rpcdbproto.NewIteratorWithStartAndPrefixResponse, error)
- func (db *DatabaseServer) Put(_ context.Context, req *rpcdbproto.PutRequest) (*rpcdbproto.PutResponse, error)
- func (db *DatabaseServer) Stat(_ context.Context, req *rpcdbproto.StatRequest) (*rpcdbproto.StatResponse, error)
- func (db *DatabaseServer) WriteBatch(_ context.Context, req *rpcdbproto.WriteBatchRequest) (*rpcdbproto.WriteBatchResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseClient ¶
type DatabaseClient struct {
// contains filtered or unexported fields
}
DatabaseClient is an implementation of database that talks over RPC.
func NewClient ¶
func NewClient(client rpcdbproto.DatabaseClient) *DatabaseClient
NewClient returns a database instance connected to a remote database instance
func (*DatabaseClient) Compact ¶
func (db *DatabaseClient) Compact(start, limit []byte) error
Compact returns nil
func (*DatabaseClient) Delete ¶
func (db *DatabaseClient) Delete(key []byte) error
Delete returns nil
func (*DatabaseClient) Get ¶
func (db *DatabaseClient) Get(key []byte) ([]byte, error)
Get returns nil, error
func (*DatabaseClient) Has ¶
func (db *DatabaseClient) Has(key []byte) (bool, error)
Has returns false, nil
func (*DatabaseClient) NewBatch ¶
func (db *DatabaseClient) NewBatch() database.Batch
NewBatch returns a new batch
func (*DatabaseClient) NewIterator ¶
func (db *DatabaseClient) NewIterator() database.Iterator
NewIterator implements the Database interface
func (*DatabaseClient) NewIteratorWithPrefix ¶
func (db *DatabaseClient) NewIteratorWithPrefix(prefix []byte) database.Iterator
NewIteratorWithPrefix implements the Database interface
func (*DatabaseClient) NewIteratorWithStart ¶
func (db *DatabaseClient) NewIteratorWithStart(start []byte) database.Iterator
NewIteratorWithStart implements the Database interface
func (*DatabaseClient) NewIteratorWithStartAndPrefix ¶
func (db *DatabaseClient) NewIteratorWithStartAndPrefix(start, prefix []byte) database.Iterator
NewIteratorWithStartAndPrefix returns a new empty iterator
type DatabaseServer ¶
type DatabaseServer struct {
// contains filtered or unexported fields
}
DatabaseServer is a database that is managed over RPC.
func NewServer ¶
func NewServer(db database.Database) *DatabaseServer
NewServer returns a database instance that is managed remotely
func (*DatabaseServer) Close ¶
func (db *DatabaseServer) Close(_ context.Context, _ *rpcdbproto.CloseRequest) (*rpcdbproto.CloseResponse, error)
Close ...
func (*DatabaseServer) Compact ¶
func (db *DatabaseServer) Compact(_ context.Context, req *rpcdbproto.CompactRequest) (*rpcdbproto.CompactResponse, error)
Compact ...
func (*DatabaseServer) Delete ¶
func (db *DatabaseServer) Delete(_ context.Context, req *rpcdbproto.DeleteRequest) (*rpcdbproto.DeleteResponse, error)
Delete ...
func (*DatabaseServer) Get ¶
func (db *DatabaseServer) Get(_ context.Context, req *rpcdbproto.GetRequest) (*rpcdbproto.GetResponse, error)
Get ...
func (*DatabaseServer) Has ¶
func (db *DatabaseServer) Has(_ context.Context, req *rpcdbproto.HasRequest) (*rpcdbproto.HasResponse, error)
Has ...
func (*DatabaseServer) IteratorError ¶
func (db *DatabaseServer) IteratorError(_ context.Context, req *rpcdbproto.IteratorErrorRequest) (*rpcdbproto.IteratorErrorResponse, error)
IteratorError ...
func (*DatabaseServer) IteratorNext ¶
func (db *DatabaseServer) IteratorNext(_ context.Context, req *rpcdbproto.IteratorNextRequest) (*rpcdbproto.IteratorNextResponse, error)
IteratorNext ...
func (*DatabaseServer) IteratorRelease ¶
func (db *DatabaseServer) IteratorRelease(_ context.Context, req *rpcdbproto.IteratorReleaseRequest) (*rpcdbproto.IteratorReleaseResponse, error)
IteratorRelease ...
func (*DatabaseServer) NewIteratorWithStartAndPrefix ¶
func (db *DatabaseServer) NewIteratorWithStartAndPrefix(_ context.Context, req *rpcdbproto.NewIteratorWithStartAndPrefixRequest) (*rpcdbproto.NewIteratorWithStartAndPrefixResponse, error)
NewIteratorWithStartAndPrefix ...
func (*DatabaseServer) Put ¶
func (db *DatabaseServer) Put(_ context.Context, req *rpcdbproto.PutRequest) (*rpcdbproto.PutResponse, error)
Put ...
func (*DatabaseServer) Stat ¶
func (db *DatabaseServer) Stat(_ context.Context, req *rpcdbproto.StatRequest) (*rpcdbproto.StatResponse, error)
Stat ...
func (*DatabaseServer) WriteBatch ¶
func (db *DatabaseServer) WriteBatch(_ context.Context, req *rpcdbproto.WriteBatchRequest) (*rpcdbproto.WriteBatchResponse, error)
WriteBatch ...