storage

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileName = "configkv.db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KVStore

type KVStore struct {
	DBDir  string
	DBName string
	// contains filtered or unexported fields
}

func NewKVStore

func NewKVStore(dbdir string, options ...OptionFunc) (*KVStore, error)

func (*KVStore) Close

func (kv *KVStore) Close() error

func (*KVStore) Delete

func (kv *KVStore) Delete(ctx context.Context, bucket, key string) error

func (*KVStore) DeleteBucket

func (kv *KVStore) DeleteBucket(ctx context.Context, bucket string) error

func (*KVStore) Get

func (kv *KVStore) Get(ctx context.Context, bucketName, key string) ([]byte, error)

func (*KVStore) Put

func (kv *KVStore) Put(ctx context.Context, bucket, key string, value []byte) error

type OptionFunc

type OptionFunc func(*KVStore)

func WithDBName

func WithDBName(name string) OptionFunc

func WithLogger

func WithLogger(l *zap.Logger) OptionFunc

Jump to

Keyboard shortcuts

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