Documentation
¶
Overview ¶
Package memory contains in-memory 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
- func (db *DB) SetNow(t time.Time)
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
}
func NewDB ¶
func NewDB(versionedKVs ...*bt.VersionedKV) (*DB, error)
NewDB constructs a in-memory bitemporal DB.
The database may optionally be seeded with "versioned key-value" records. No two records for the same key may overlap both transaction time and valid time. Transaction times (which normally default to now) may optionally be controlled with SetNow.
func (*DB) History ¶
func (db *DB) History(key string) ([]*bt.VersionedKV, error)
History returns versions by descending end transaction time, descending end valid time
Click to show internal directories.
Click to hide internal directories.