backends

package
v0.0.0-...-eb0179f Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound error = fmt.Errorf("key not found\n")

Functions

This section is empty.

Types

type Bolt

type Bolt struct {
	Db *bolt.DB
	// contains filtered or unexported fields
}

func GetBolt

func GetBolt(dbname string) (*Bolt, error)

func NewBolt

func NewBolt(dbname string) (*Bolt, error)

func (*Bolt) Close

func (b *Bolt) Close() error

func (*Bolt) Del

func (b *Bolt) Del(key []byte)

func (*Bolt) Get

func (b *Bolt) Get(value []byte) (result []byte, err error)

func (*Bolt) Len

func (b *Bolt) Len() (value int)

func (*Bolt) Open

func (b *Bolt) Open(name string) error

func (*Bolt) Put

func (b *Bolt) Put(key []byte, value []byte) error

func (*Bolt) Query

func (b *Bolt) Query(name []byte, t string) (result map[string][]byte, err error)

type DB

type DB interface {
	Get(value []byte) ([]byte, error)
	Put(key []byte, value []byte) error
	Del(key []byte)
	Query(key []byte, t string) (map[string][]byte, error)
	Close() error
}

type Mem

type Mem struct {
	Db map[string]string
}

func NewMap

func NewMap() *Mem

func (*Mem) Close

func (m *Mem) Close() error

func (*Mem) Del

func (m *Mem) Del(key []byte)

func (*Mem) Get

func (m *Mem) Get(key []byte) ([]byte, error)

func (*Mem) Put

func (m *Mem) Put(key []byte, value []byte) error

func (*Mem) Query

func (m *Mem) Query(key []byte, str string) (map[string][]byte, error)

Jump to

Keyboard shortcuts

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