keyvaluestore

package
v0.0.0-...-1bea25e Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrExpectedBoltKeyValueStoreOptions = errors.Error("expected BoltKeyValueStoreOptions type")
	ErrInvalidBucketName                = errors.Error("invalid bucket name")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltKeyValueStore

type BoltKeyValueStore struct {
	BucketName string
	// contains filtered or unexported fields
}

func NewBoltKeyValueStore

func NewBoltKeyValueStore() *BoltKeyValueStore

func (*BoltKeyValueStore) Get

func (st *BoltKeyValueStore) Get(key string) (ret []byte, ok bool, err error)

func (*BoltKeyValueStore) GetAll

func (st *BoltKeyValueStore) GetAll() ([][]byte, error)

func (*BoltKeyValueStore) GetTip

func (st *BoltKeyValueStore) GetTip(key string) ([]byte, bool, error)

func (*BoltKeyValueStore) Init

func (st *BoltKeyValueStore) Init(options interface{}) error

func (*BoltKeyValueStore) IsEmpty

func (st *BoltKeyValueStore) IsEmpty() (isEmpty bool)

func (*BoltKeyValueStore) Put

func (st *BoltKeyValueStore) Put(key string, value []byte) error

func (*BoltKeyValueStore) Size

func (st *BoltKeyValueStore) Size() (size int)

type BoltKeyValueStoreOptions

type BoltKeyValueStoreOptions struct {
	BucketName string
	DbFile     string
}

type MemoryKeyValueStore

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

func NewMemoryKeyValueStore

func NewMemoryKeyValueStore() *MemoryKeyValueStore

func (*MemoryKeyValueStore) Get

func (st *MemoryKeyValueStore) Get(key string) ([]byte, bool, error)

func (*MemoryKeyValueStore) GetAll

func (st *MemoryKeyValueStore) GetAll() ([][]byte, error)

func (*MemoryKeyValueStore) GetTip

func (st *MemoryKeyValueStore) GetTip(key string) ([]byte, bool, error)

func (*MemoryKeyValueStore) Init

func (st *MemoryKeyValueStore) Init(options interface{}) error

func (*MemoryKeyValueStore) IsEmpty

func (st *MemoryKeyValueStore) IsEmpty() bool

func (*MemoryKeyValueStore) Put

func (st *MemoryKeyValueStore) Put(key string, value []byte) error

func (*MemoryKeyValueStore) Size

func (st *MemoryKeyValueStore) Size() int

type Storer

type Storer interface {
	Init(options interface{}) error
	Put(key string, value []byte) error
	Get(key string) ([]byte, bool, error)
	GetAll() ([][]byte, error)
	GetTip(key string) ([]byte, bool, error)
	IsEmpty() bool
	Size() int
}

Jump to

Keyboard shortcuts

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