Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
func Close() (err error)
Close closes the underlying rixxdb / dendrodb database connection, enabling the underlying database to clean up remainging transactions.
func Export ¶
Export saves all database operations to a writer. This can be used to save a database snapshot to a secondary file or stream.
func Import ¶
Import loads database operations from a reader. This can be used to playback a database snapshot into an already running database.
Types ¶
type DB ¶
type DB interface { Begin(context.Context, bool) (TX, error) Import(io.Reader) error Export(io.Writer) error Close() error }
DB represents a database implementation
type DBError ¶
type DBError struct {
Err error
}
DBError is an error which occurs when there is a problem with writing keys/values to the database.
type DS ¶
type DS struct {
// contains filtered or unexported fields
}
DB represents a backing datastore.
func (*DS) Begin ¶
Begin begins a new read / write transaction with the underlying database, and returns the transaction, or any error which occured.
func (*DS) Close ¶
Close closes the underlying rixxdb / dendrodb database connection, enabling the underlying database to clean up remainging transactions.
type TX ¶
type TX interface { Closed() bool Cancel() error Commit() error All(context.Context, []byte) ([]KV, error) AllP(context.Context, []byte, uint64) ([]KV, error) AllR(context.Context, []byte, []byte, uint64) ([]KV, error) Clr(context.Context, []byte) (KV, error) ClrP(context.Context, []byte, uint64) ([]KV, error) ClrR(context.Context, []byte, []byte, uint64) ([]KV, error) Put(context.Context, int64, []byte, []byte) (KV, error) PutC(context.Context, int64, []byte, []byte, []byte) (KV, error) Get(context.Context, int64, []byte) (KV, error) GetP(context.Context, int64, []byte, uint64) ([]KV, error) GetR(context.Context, int64, []byte, []byte, uint64) ([]KV, error) Del(context.Context, int64, []byte) (KV, error) DelC(context.Context, int64, []byte, []byte) (KV, error) DelP(context.Context, int64, []byte, uint64) ([]KV, error) DelR(context.Context, int64, []byte, []byte, uint64) ([]KV, error) }
TX represents a database transaction