localdb

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalDB

type LocalDB struct {
	// contains filtered or unexported fields
}

LocalDB is a BoltDB backed datastore

func New

func New(dbPath string) (*LocalDB, error)

New returns a new datastore

func (*LocalDB) Close

func (l *LocalDB) Close() error

Close is used to close and release all resources

func (*LocalDB) Delete

func (l *LocalDB) Delete(key string) error

Delete removes a record from the datastore

func (*LocalDB) Export

func (l *LocalDB) Export() ([]byte, error)

Export exports all records from the datastore

func (*LocalDB) Get

func (l *LocalDB) Get(key string) ([]*api.Record, error)

Get returns records for the specified key

func (*LocalDB) ID

func (l *LocalDB) ID() string

ID returns the id of the service

func (*LocalDB) Search

func (l *LocalDB) Search(query string, filters ...ds.Filter) ([]*api.Record, error)

Search returns records for the specified query using optional filters

func (*LocalDB) Set

func (l *LocalDB) Set(key string, r []*api.Record) error

Set creates the specified record

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL