dbutil

package
v0.8.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v0.6.0

func Get(db *bolt.DB, name string, record Record) error

Get retrieves a record from the database, decrypts it and loads it into record.

func GetBucketName added in v0.7.0

func GetBucketName(r Record) []byte

GetBucketName returns the bucket name depending on the type of the record passed.

func List added in v0.6.0

func List[R Record](db *bolt.DB, record R) ([]R, error)

List returns a list of decrypted records from the database.

func ListNames

func ListNames(db *bolt.DB, bucketName []byte) ([]string, error)

ListNames returns a list with all the records names.

func Put added in v0.6.0

func Put(b *bolt.Bucket, record Record) error

Put encrypts and saves a record into the database.

func Remove

func Remove(db *bolt.DB, bucketName []byte, names ...string) error

Remove removes records from the database.

func SetContext

func SetContext(t testing.TB, bucketName []byte) *bolt.DB

SetContext creates a bucket and its context to test the database operations.

Types

type Record added in v0.6.0

type Record interface {
	GetName() string
	proto.Message
}

Record is an interface that all Kure objects implement.

Directories

Path Synopsis
Package bucket contains the database buckets where records are stored.
Package bucket contains the database buckets where records are stored.

Jump to

Keyboard shortcuts

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