boltdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Delete

func Delete(bucket, key []byte)

func ForEach

func ForEach(bucket []byte, f FETCH_CALLBACK)

func Get

func Get(bucket, key []byte) []byte

func NextId

func NextId(bucket []byte) int64

func Prefix

func Prefix(bucket, prefix []byte, f FETCH_CALLBACK)

func Range

func Range(bucket, from, to []byte, f FETCH_CALLBACK)

func Set

func Set(bucket, key, value []byte)

func Transaction

func Transaction(f TRANSACTION_CALLBACK)

Types

type Bucket

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

func (*Bucket) Bucket

func (b *Bucket) Bucket(name string) (*Bucket, error)

func (*Bucket) Delete

func (b *Bucket) Delete(key []byte) error

func (*Bucket) DeleteBucket

func (b *Bucket) DeleteBucket(name string) error

func (*Bucket) Get

func (b *Bucket) Get(key []byte) []byte

func (*Bucket) NextId

func (b *Bucket) NextId() int64

func (*Bucket) Prefix

func (b *Bucket) Prefix(prefix []byte, f FETCH_CALLBACK)

func (*Bucket) Range

func (b *Bucket) Range(from, to []byte, f FETCH_CALLBACK)

func (*Bucket) Set

func (b *Bucket) Set(key, value []byte) error

type Config

type Config struct {
	Database string `json:"database"`
	Mask     int    `json:"mask"`
	ReadOnly bool   `json:"read_only"`
	Timeout  int    `json:"timeout"`
}

type DB

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

func Open

func Open(cfg *Config, def bool) (*DB, error)

func (*DB) Close

func (db *DB) Close()

func (*DB) Delete

func (db *DB) Delete(bucket, key []byte)

func (*DB) ForEach

func (db *DB) ForEach(bucket []byte, f FETCH_CALLBACK)

func (*DB) Get

func (db *DB) Get(bucket, key []byte) []byte

func (*DB) NextId

func (db *DB) NextId(bucket []byte) int64

func (*DB) Prefix

func (db *DB) Prefix(bucket, prefix []byte, f FETCH_CALLBACK)

func (*DB) Range

func (db *DB) Range(bucket, from, to []byte, f FETCH_CALLBACK)

func (*DB) Set

func (db *DB) Set(bucket, key, value []byte)

func (*DB) Transaction

func (db *DB) Transaction(f TRANSACTION_CALLBACK)

type FETCH_CALLBACK

type FETCH_CALLBACK func(key, value []byte) bool

type TRANSACTION_CALLBACK

type TRANSACTION_CALLBACK func(tx *Tx) error

type Tx

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

func (*Tx) Bucket

func (tx *Tx) Bucket(name string) (*Bucket, error)

func (*Tx) DeleteBucket

func (tx *Tx) DeleteBucket(name string) error

Jump to

Keyboard shortcuts

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