Documentation
¶
Index ¶
- type DB
- func (d *DB) Backup(w io.Writer, sinceUnix int64) (int64, error)
- func (d *DB) Close() func()
- func (d *DB) Exists(key string) bool
- func (d *DB) FuncMap() template.FuncMap
- func (d *DB) Get(key string) (Record, error)
- func (d *DB) GetMany(keys []string) (map[string]Record, error)
- func (d *DB) GetPrefix(prefix string) (map[string]Record, error)
- func (d *DB) GetRegex(meta byte, regex string) (map[string]Record, error)
- func (d *DB) LoadBackup(r io.Reader, maxPendingBytes int64) error
- func (d *DB) Set(r Record) error
- func (d *DB) SetMany(jsonMap map[string]Record) error
- func (d *DB) Start() error
- type Opts
- type Record
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 embedded JSON database
func (*DB) Backup ¶
Backup dumps a protobuf-encoded list of all entries in the database into the given writer, that are newer than the specified version. It returns a timestamp indicating when the entries were dumped which can be passed into a later invocation to generate an incremental dump
func (*DB) Close ¶
func (d *DB) Close() func()
Close closes all channels then shuts down the database
func (*DB) GetMany ¶
GetMany returns a map of records that have keys that exactly match the input keys. The database key is the index on the returned map.
func (*DB) GetPrefix ¶
GetPrefix returns a map of records that have keys that match the prefix pattern. The database key is the index on the returned map.
func (*DB) GetRegex ¶
GetRegex returns a map of records that have keys that match the regex pattern. The database key is the index on the returned map.
func (*DB) LoadBackup ¶
Load reads a protobuf-encoded list of all entries from a reader and writes them to the database.