boltdb

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const RequestsBucketName = "rqbucket"

RequestsBucketName - default name for BoltDB bucket

Variables

This section is empty.

Functions

func GetDB

func GetDB(name string) *bolt.DB

GetDB - returns open BoltDB database with read/write permissions or goes down in flames if something bad happends

Types

type BoltCache

type BoltCache struct {
	DS            *bolt.DB
	CurrentBucket []byte
}

BoltCache - container to implement Cache instance with BoltDB backend for storage

func NewBoltDBCache

func NewBoltDBCache(db *bolt.DB, bucket []byte) *BoltCache

NewBoltDBCache - returns new BoltCache instance

func (*BoltCache) CloseDB

func (c *BoltCache) CloseDB()

CloseDB - closes database

func (*BoltCache) Delete

func (c *BoltCache) Delete(key []byte) error

Delete - deletes specified key

func (*BoltCache) DeleteBucket

func (c *BoltCache) DeleteBucket(name []byte) (err error)

DeleteBucket - deletes bucket with all saved data

func (*BoltCache) DeleteData

func (c *BoltCache) DeleteData() error

DeleteData - deletes bucket with all saved data

func (*BoltCache) Get

func (c *BoltCache) Get(key []byte) (value []byte, err error)

Get - searches for given key in the cache and returns value if found

func (*BoltCache) GetAllEntries

func (c *BoltCache) GetAllEntries() (values map[string][]byte, err error)

GetAllEntries - returns all keys/values

func (*BoltCache) GetAllKeys

func (c *BoltCache) GetAllKeys() (keys map[string]bool, err error)

GetAllKeys - gets all current keys

func (*BoltCache) GetAllValues

func (c *BoltCache) GetAllValues() (values [][]byte, err error)

GetAllValues - returns all values

func (*BoltCache) RecordsCount

func (c *BoltCache) RecordsCount() (count int, err error)

RecordsCount - returns records count

func (*BoltCache) Set

func (c *BoltCache) Set(key, value []byte) error

Set - saves given key and value pair to cache

Jump to

Keyboard shortcuts

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