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.NewInsecure(addr) // 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() ds, de := itr.Domain() } stats := client.Stats() if !client.Has(dk1) { client.SetSync(dk1, dv1) }
Index ¶
- type Init
- type RemoteDB
- func (rd *RemoteDB) Close()
- func (rd *RemoteDB) Delete(key []byte)
- func (rd *RemoteDB) DeleteSync(key []byte)
- func (rd *RemoteDB) Get(key []byte) []byte
- func (rd *RemoteDB) Has(key []byte) bool
- func (rd *RemoteDB) InitRemote(in *Init) error
- func (rd *RemoteDB) Iterator(start, end []byte) db.Iterator
- func (rd *RemoteDB) NewBatch() db.Batch
- func (rd *RemoteDB) Print()
- func (rd *RemoteDB) ReverseIterator(start, end []byte) db.Iterator
- func (rd *RemoteDB) Set(key, value []byte)
- func (rd *RemoteDB) SetSync(key, value []byte)
- 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) Print ¶
func (rd *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 ¶
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. |
Package protodb is a generated protocol buffer package.
|
Package protodb is a generated protocol buffer package. |