bbolt

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.4.0

type Options struct {
	File   string `toml:"file"`
	Bucket string `toml:"bucket"`
}

type Storage

type Storage[V any] struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage[V any](o Options) (*Storage[V], error)

func (*Storage[V]) Close

func (s *Storage[V]) Close() error

Gracefull close of database

func (*Storage[V]) Delete

func (s *Storage[V]) Delete(k string) error

Deletes a key-value pair from a storage Returns an error if given key is not valid or update operation failed

func (*Storage[V]) Get

func (s *Storage[V]) Get(k string, v *V) (bool, error)

Retrieves a stored value by a given key Returns a false, nil if no value have been found for a given key Returns an error if it occured during retrieving of value Expects keys that are not ""

func (*Storage[V]) Set

func (s *Storage[V]) Set(k string, v V) error

Saves data into bbolt storage Returns an error, if given key is not valid

Jump to

Keyboard shortcuts

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