boltdb

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bolt

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

Bolt is a wrapper around boltdb

func NewStorage

func NewStorage(path string) (*Bolt, error)

NewStorage creates a new BoltDB storage for service promises

func (*Bolt) Close

func (b *Bolt) Close() error

Close closes database

func (*Bolt) DB

func (b *Bolt) DB() *storm.DB

DB returns raw storm DB.

func (*Bolt) Delete

func (b *Bolt) Delete(bucket string, data interface{}) error

Delete removes the given struct from the given bucket

func (*Bolt) DeleteKey

func (b *Bolt) DeleteKey(bucket string, key interface{}) error

DeleteKey the given struct from the given bucket

func (*Bolt) GetAllFrom

func (b *Bolt) GetAllFrom(bucket string, data interface{}) error

GetAllFrom allows to get all structs from the bucket

func (*Bolt) GetBuckets

func (b *Bolt) GetBuckets() []string

GetBuckets returns a list of buckets

func (*Bolt) GetLast

func (b *Bolt) GetLast(bucket string, to interface{}) error

GetLast returns the last entry in the bucket

func (*Bolt) GetOneByField

func (b *Bolt) GetOneByField(bucket string, fieldName string, key interface{}, to interface{}) error

GetOneByField returns an object from the given bucket by the given field

func (*Bolt) GetValue

func (b *Bolt) GetValue(bucket string, key interface{}, to interface{}) error

GetValue gets key value

func (*Bolt) Lock

func (b *Bolt) Lock()

Lock locks underlying RWMutex for write

func (*Bolt) RLock

func (b *Bolt) RLock()

RLock locks underlying RWMutex for reading

func (*Bolt) RUnlock

func (b *Bolt) RUnlock()

RUnlock unlocks underlying RWMutex for reading

func (*Bolt) SetValue

func (b *Bolt) SetValue(bucket string, key interface{}, to interface{}) error

SetValue sets key value

func (*Bolt) Store

func (b *Bolt) Store(bucket string, data interface{}) error

Store allows to keep struct grouped by the bucket

func (*Bolt) Unlock

func (b *Bolt) Unlock()

Unlock unlocks underlying RWMutex for write

func (*Bolt) Update

func (b *Bolt) Update(bucket string, object interface{}) error

Update allows to update the struct in the given bucket

Directories

Path Synopsis
Package boltdbtest contains the utitilies needed for boltdb testing
Package boltdbtest contains the utitilies needed for boltdb testing

Jump to

Keyboard shortcuts

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