boltdb

package
v0.0.0-...-217b4b9 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

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

BoltDB method struct

func New

func New(path string) (db *BoltDB, err error)

Open the bolt DB file in given path

func (*BoltDB) Add

func (boltdb *BoltDB) Add(bucketName, key, value []byte) (err error)

Adds given key-value pair to DB file

func (*BoltDB) AddBucket

func (boltdb *BoltDB) AddBucket(bucketName []byte) (err error)

Adds a new bucket to the DB file

func (*BoltDB) Close

func (boltdb *BoltDB) Close()

Close the bolt DB file

func (*BoltDB) Delete

func (boltdb *BoltDB) Delete(bucketName, key []byte) (err error)

Deletes given key from DB file

func (*BoltDB) RemoveBucket

func (boltdb *BoltDB) RemoveBucket(bucketName []byte) (err error)

Removes the bucket from the DB file

func (*BoltDB) Update

func (boltdb *BoltDB) Update(bucketName, key, value []byte) (err error)

Updates given key in DB file

func (*BoltDB) View

func (boltdb *BoltDB) View() (views []BoltView, err error)

Open the bolt DB file in given path and return data from the DB file

type BoltView

type BoltView struct {
	BucketName string       `json:"bucket_name"`
	BucketView []BucketView `json:"bucket_view"`
}

BoltView struct for bucket-key-value mapping

type BucketView

type BucketView struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

BucketView struct for key-value mapping

Jump to

Keyboard shortcuts

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