bbolt

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package db implements simple method of treatment to bbolt db.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Objects ManagerI
	// contains filtered or unexported fields
}

Bucket implements interface simple access to read/write in bbolt db.

func (*Bucket) Count

func (bucket *Bucket) Count() uint

func (*Bucket) DB

func (bucket *Bucket) DB() DB

DB returns pointer to DB.

func (*Bucket) Delete

func (bucket *Bucket) Delete(keyI any) error

Delete implements Deleting value of key in bucket.

func (*Bucket) DeleteAll

func (bucket *Bucket) DeleteAll() error

DeleteAll implements Deleting all values in bucket.

func (*Bucket) Get

func (bucket *Bucket) Get(keyI any) (Model, error)

Get implements getting value of key in bucket.

func (*Bucket) Manager

func (bucket *Bucket) Manager() ManagerI

func (*Bucket) Model

func (bucket *Bucket) Model() Model

Model returns string, name of Bucket.

func (*Bucket) Name

func (bucket *Bucket) Name() string

Name returns string, name of Bucket.

func (*Bucket) Save

func (bucket *Bucket) Save(model Model) error

func (*Bucket) SetManager added in v0.13.0

func (bucket *Bucket) SetManager(newManager ManagerI)

type DataBase

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

DataBase implements interface access to bbolt db.

func Open

func Open(path string) (*DataBase, error)

Open return pointer to DataBase, If DataBase does not exist then error.

func (*DataBase) BoltDB

func (db *DataBase) BoltDB() *bolt.DB

func (*DataBase) Close

func (db *DataBase) Close() error

Close implements access to close DataBase.

func (*DataBase) ExistsTable

func (db *DataBase) ExistsTable(name string) bool

ExistsBucket returns true if bucket exists.

func (*DataBase) Table

func (db *DataBase) Table(_ string, model Model) (Table, error)

Table returns pointer to Bucket in db, Returns error if name is too long. name is not required

func (*DataBase) TableFromCache added in v0.12.1

func (db *DataBase) TableFromCache(name string) Table

Jump to

Keyboard shortcuts

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