Documentation
¶
Overview ¶
Package memory implements an in-memory, bitemporal key-value database. This is the reference implementation of bitempura.DB.
Index ¶
- type DB
- func (db *DB) Delete(key string, opts ...bt.WriteOpt) error
- func (db *DB) Get(key string, opts ...bt.ReadOpt) (*bt.VersionedKV, error)
- func (db *DB) History(key string) ([]*bt.VersionedKV, error)
- func (db *DB) List(opts ...bt.ReadOpt) ([]*bt.VersionedKV, error)
- func (db *DB) Set(key string, value bt.Value, opts ...bt.WriteOpt) error
- type DBOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is an in-memory, bitemporal key-value database.
func (*DB) History ¶
func (db *DB) History(key string) ([]*bt.VersionedKV, error)
History returns versions by descending end transaction time, descending end valid time
type DBOpt ¶ added in v0.2.3
type DBOpt func(*dbOptions)
DBOpt is an option for constructing databases
func WithClock ¶ added in v0.2.3
WithClock constructs database with a clock in order to control transaction times. This is used for testing.
func WithVersionedKVs ¶ added in v0.2.3
func WithVersionedKVs(versionedKVs []*bt.VersionedKV) DBOpt
WithVersionedKVs constructs database with seeded "versioned key-value" records. No two records for the same key may overlap both transaction time and valid time.
Click to show internal directories.
Click to hide internal directories.