storage

package
v0.0.0-...-05e2c8e Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStore

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

BoltStore is a Bolt backed bucket key value store

func NewBoltStore

func NewBoltStore(path string) (*BoltStore, error)

NewBoltStore returns a new BoltStore

func (*BoltStore) DeleteAll

func (bs *BoltStore) DeleteAll(bucket string) error

DeleteAll deletes all key-value pairs stored in a bucket

func (*BoltStore) Get

func (bs *BoltStore) Get(bucket string, key string) (val string, err error)

Get retrieves a value from a bucket

func (*BoltStore) GetAll

func (bs *BoltStore) GetAll(bucket string) (vals map[string]string, err error)

GetAll retrieves all key-value pairs from a bucket

func (*BoltStore) InitBucket

func (bs *BoltStore) InitBucket(bucket string) error

InitBucket initialises a bucket

func (*BoltStore) Put

func (bs *BoltStore) Put(bucket string, key string, value string) error

Put stores a key-value pair in a bucket

type BucketKeyValueStore

type BucketKeyValueStore interface {
	InitBucket(bucket string) error
	Get(bucket string, key string) (string, error)
	Put(bucket string, key string, value string) error
	GetAll(bucket string) (map[string]string, error)
	DeleteAll(bucket string) error
}

BucketKeyValueStore represents a bucket key value store

Jump to

Keyboard shortcuts

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