db

package
v0.0.0-...-b95dbb3 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketNotFoundErr

func BucketNotFoundErr(b Bucket) error

BucketNotFoundErr indicates that the given Bucket was not yet created.

func DeleteByKey

func DeleteByKey(d DB, bucket Bucket, key []byte) error

DeleteByKey deletes the value stored with the given key from d. If key is not found, the error returned will be nil.

func GetByKey

func GetByKey(d DB, bucket Bucket, key []byte) ([]byte, error)

GetByKey retrieves the value stored in d with the given key.

func SetupBuckets

func SetupBuckets(d DB, buckets []Bucket) error

SetupBuckets creates the given Buckets if they do not already exist in d.

func StoreKeyValue

func StoreKeyValue(d DB, bucket Bucket, key []byte, value interface{}) error

StoreKeyValue marshals the given value as JSON and stores it in d at the given key.

Types

type Bucket

type Bucket string

Bucket is a named database partition.

type DB

type DB interface {
	// Begin(writable bool) (*bolt.Tx, error)
	// Close() error
	// GoString() string
	// Info() *Info
	// Path() string
	// Stats() Stats
	// String() string
	Update(fn func(*bolt.Tx) error) error
	View(fn func(*bolt.Tx) error) error
}

DB specifies the basic methods that a database must implement to be used as a backend.

Jump to

Keyboard shortcuts

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