db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGameBucket = errors.New("No game bucket")
	ErrPutData      = errors.New("Put data")
	ErrProtoMarshal = errors.New("Marshal data")
)

Error declarations

Functions

This section is empty.

Types

type DB

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

DB is the controller for all BoltDB operations

func NewDB

func NewDB(log *logrus.Logger, name string) *DB

NewDB returns a new instance of a DB

func OpenDB

func OpenDB(log *logrus.Logger, name string) (*DB, error)

OpenDB opens a BoltDB for writing

func OpenReadDB

func OpenReadDB(log *logrus.Logger, name string) (*DB, error)

OpenReadDB opens a BoltDB for reading

func (*DB) Close

func (store *DB) Close() error

Close closes off a DB

func (*DB) Load

func (store *DB) Load(bucket, key string, data proto.Message) error

Load loads a record from the DB

func (*DB) Save

func (store *DB) Save(bucket, key string, data proto.Message) error

Save writes a record to the DB

Jump to

Keyboard shortcuts

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