stablestore

package
v0.0.0-...-16dfdc2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VDLMetadataFile = "vdl.db"
	BucketName      = "vdl_metadata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDBStore

type BoltDBStore struct {
	Conf       *BoltDBStoreConfig
	DB         *bolt.DB
	BucketName []byte
}

func NewBoltDBStore

func NewBoltDBStore(conf *BoltDBStoreConfig) (*BoltDBStore, error)

func (*BoltDBStore) Close

func (s *BoltDBStore) Close() error

func (*BoltDBStore) Get

func (s *BoltDBStore) Get(key []byte) ([]byte, error)

func (*BoltDBStore) GetBatch

func (s *BoltDBStore) GetBatch(keys []string) (map[string][]byte, error)

func (*BoltDBStore) Put

func (s *BoltDBStore) Put(key []byte, value []byte) error

type BoltDBStoreConfig

type BoltDBStoreConfig struct {
	//boltdb dir
	Dir string
}

type InmemStableStore

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

InmemStore implements the LogStore and StableStore interface. It should NOT EVER be used for production. It is used only for unit tests. Use the MDBStore implementation instead.

func NewInmemStableStore

func NewInmemStableStore() *InmemStableStore

NewInmemStore returns a new in-memory backend. Do not ever use for production. Only for testing.

func (*InmemStableStore) Close

func (i *InmemStableStore) Close() error

func (*InmemStableStore) Get

func (i *InmemStableStore) Get(key []byte) ([]byte, error)

func (*InmemStableStore) GetBatch

func (i *InmemStableStore) GetBatch(keys []string) (map[string][]byte, error)

func (*InmemStableStore) Put

func (i *InmemStableStore) Put(key []byte, val []byte) error

type StableStore

type StableStore interface {
	Put(key []byte, value []byte) error

	// Get returns the value for key, or an empty byte slice if key was not found.
	Get(key []byte) ([]byte, error)

	Close() error

	GetBatch(keys []string) (map[string][]byte, error)
}

StableStore is used to provide stable storage of key configurations to ensure safety.

Jump to

Keyboard shortcuts

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