Documentation ¶
Overview ¶
remotedb is a package for connecting to distributed Tendermint db.DB instances. The purpose is to detach difficult deployments such as CLevelDB that requires gcc or perhaps for databases that require custom configurations such as extra disk space. It also eases the burden and cost of deployment of dependencies for databases to be used by Tendermint developers. Most importantly it is built over the high performant gRPC transport.
remotedb's RemoteDB implements db.DB so can be used normally like other databases. One just has to explicitly connect to the remote database with a client setup such as:
client, err := remotedb.NewRemoteDB(addr, cert) // Make sure to invoke InitRemote! if err := client.InitRemote(&remotedb.Init{Name: "test-remote-db", Type: "leveldb"}); err != nil { log.Fatalf("Failed to initialize the remote db") } client.Set(key1, value) gv1 := client.SetSync(k2, v2) client.Delete(k1) gv2 := client.Get(k1) for itr := client.Iterator(k1, k9); itr.Valid(); itr.Next() { ik, iv := itr.Key(), itr.Value() } stats := client.Stats() if !client.Has(dk1) { client.SetSync(dk1, dv1) }
Index ¶
- type Init
- type RemoteDB
- func (rd *RemoteDB) Close() error
- func (rd *RemoteDB) Delete(key []byte) error
- func (rd *RemoteDB) DeleteSync(key []byte) error
- func (rd *RemoteDB) Get(key []byte) ([]byte, error)
- func (rd *RemoteDB) Has(key []byte) (bool, error)
- func (rd *RemoteDB) InitRemote(in *Init) error
- func (rd *RemoteDB) Iterator(start, end []byte) (db.Iterator, error)
- func (rd *RemoteDB) Name() string
- func (rd *RemoteDB) NewBatch() db.Batch
- func (rd *RemoteDB) PrefixIterator(prefix []byte) (db.Iterator, error)
- func (rd *RemoteDB) Print() error
- func (rd *RemoteDB) ReverseIterator(start, end []byte) (db.Iterator, error)
- func (rd *RemoteDB) ReversePrefixIterator(prefix []byte) (db.Iterator, error)
- func (rd *RemoteDB) Set(key, value []byte) error
- func (rd *RemoteDB) SetSync(key, value []byte) error
- func (rd *RemoteDB) Stats() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteDB ¶
type RemoteDB struct {
// contains filtered or unexported fields
}
func (*RemoteDB) DeleteSync ¶
func (*RemoteDB) InitRemote ¶
func (*RemoteDB) PrefixIterator ¶
func (*RemoteDB) Print ¶
TODO: Implement Print when db.DB implements a method to print to a string and not db.Print to stdout.
func (*RemoteDB) ReverseIterator ¶
func (*RemoteDB) ReversePrefixIterator ¶
Directories ¶
Path | Synopsis |
---|---|
grpcdb is the distribution of Tendermint's db.DB instances using the gRPC transport to decouple local db.DB usages from applications, to using them over a network in a highly performant manner.
|
grpcdb is the distribution of Tendermint's db.DB instances using the gRPC transport to decouple local db.DB usages from applications, to using them over a network in a highly performant manner. |