db

package
v0.0.0-...-432d548 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyColName key column name
	KeyColName = "fs_key"
	// ValueColName value column name
	ValueColName = "fs_value"
)

Variables

View Source
var (
	// ErrDBMultipleEndpointsUnsupported ...
	ErrDBMultipleEndpointsUnsupported = errors.New("db supports one endpoint and should be a file path")
	// ErrDBNoEndpointGiven ...
	ErrDBNoEndpointGiven = errors.New("one endpoint at least should be given")
	// ErrDBBucketOptionMissing is thrown when boltBcuket config option is missing
	ErrDBBucketOptionMissing = errors.New("dbBucket config option missing")
)

Functions

func New

func New(endpoints []string, options *store.Config) (store.Store, error)

New ... endpoint format : [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]

func Register

func Register()

Register ...

Types

type DB

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

DB relation-db storage

func (*DB) AtomicDelete

func (r *DB) AtomicDelete(key string, previous *store.KVPair) (bool, error)

AtomicDelete ...

func (*DB) AtomicPut

func (r *DB) AtomicPut(key string, value []byte, previous *store.KVPair, options *store.WriteOptions) (bool, *store.KVPair, error)

AtomicPut ...

func (*DB) Close

func (r *DB) Close()

Close ...

func (*DB) Delete

func (r *DB) Delete(key string) error

Delete ...

func (*DB) DeleteTree

func (r *DB) DeleteTree(keyPrefix string) error

DeleteTree ...

func (*DB) Exists

func (r *DB) Exists(key string, opts *store.ReadOptions) (bool, error)

Exists ...

func (*DB) Get

func (r *DB) Get(key string, opts *store.ReadOptions) (*store.KVPair, error)

Get ...

func (*DB) List

func (r *DB) List(keyPrefix string, opts *store.ReadOptions) ([]*store.KVPair, error)

List ...

func (*DB) NewLock

func (r *DB) NewLock(key string, options *store.LockOptions) (store.Locker, error)

NewLock ...

func (*DB) Put

func (r *DB) Put(key string, value []byte, opts *store.WriteOptions) error

Put uk idx of `key` column required

func (*DB) Watch

func (r *DB) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error)

Watch ...

func (*DB) WatchTree

func (r *DB) WatchTree(directory string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan []*store.KVPair, error)

WatchTree ...

Jump to

Keyboard shortcuts

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