store

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FileEntryBucket = "file_entries"

Variables

This section is empty.

Functions

func Close

func Close() error

Close closes the store.

func DefaultDBFile

func DefaultDBFile() string

func Get

func Get(bucket string, key string, value any) error

Get retrieves a value from the store.

func Init

func Init(file string) error

Init initializes the store.

func Set

func Set(bucket string, key string, value any) error

Set stores a value in the store.

Types

type BoltStore

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

BoltStore is a Store implementation that uses BoltDB.

func Open

func Open(file string) (*BoltStore, error)

Open opens a BoltDB database.

func (*BoltStore) Get

func (s *BoltStore) Get(bucket string, key string, value any) error

Get retrieves a value from the store.

func (*BoltStore) Set

func (s *BoltStore) Set(bucket string, key string, value any) error

Set stores a value in the store.

Jump to

Keyboard shortcuts

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