Documentation ¶
Index ¶
- func Serve(db keyvalue.Beginner, conn io.ReadWriteCloser, prefix *record.Key, ...) error
- func ServeStore(store keyvalue.Store, conn io.ReadWriteCloser) error
- type DB
- type Store
- func (c *Store) Delete(key *record.Key) error
- func (c *Store) ForEach(fn func(*record.Key, []byte) error) error
- func (c *Store) ForEachHash(fn func(*record.Key, [32]byte) error) error
- func (c *Store) Get(key *record.Key) ([]byte, error)
- func (c *Store) GetBatch(keys []*record.Key) ([][]byte, error)
- func (c *Store) Put(key *record.Key, value []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
Serve opens a batch and serves it over the connection. Serve returns once the connection is closed or the remote side calls Commit. See Connect.
func ServeStore ¶
func ServeStore(store keyvalue.Store, conn io.ReadWriteCloser) error
ServeStore serves a key-value store over a connection. ServeStore returns once the connection is closed. See ConnectStore.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a remote key-value database client that creates a connection to the remote database when DB.Begin is called. See Serve.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a remote key-value store client that uses RPC to interact with the remote store. See ServeStore.
func ConnectStore ¶
func ConnectStore(conn io.ReadWriter) *Store
ConnectStore returns a Store that uses that uses RPC to interact with a remote store. See ServeStore.
func (*Store) Delete ¶
Delete implements keyvalue.Store.Delete.
func (*Store) ForEach ¶
ForEach implements keyvalue.Store.ForEach.
func (*Store) ForEachHash ¶
ForEachHash calls the callback for each key-value pair in the store. The callback is called with the value's hash instead of the value. See Store.ForEach for comparison.
func (*Store) Get ¶
Get implements keyvalue.Store.Get.