bbolt

package
v0.12.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package db implements simple method of treatment to bbolt db.

Index

Constants

View Source
const DELETE = "DELETE"

Variables

This section is empty.

Functions

func GetNameBucket added in v0.12.0

func GetNameBucket(model Model) string

func Open

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

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

Types

type Bucket

type Bucket struct {
	Objects *Manager
	// 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

type DataBase

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

DataBase implements interface access to bbolt db.

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

type Manager

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

func (*Manager) All

func (manager *Manager) All() []Model

func (*Manager) CheckModel

func (manager *Manager) CheckModel(model Model, include Params, exclude ...Params) bool

func (*Manager) CheckPointers added in v0.12.0

func (manager *Manager) CheckPointers(model Model)

func (*Manager) Copy

func (manager *Manager) Copy() ManagerI

func (*Manager) Count

func (manager *Manager) Count() uint

func (*Manager) Delete

func (manager *Manager) Delete(id any)

func (*Manager) Filter

func (manager *Manager) Filter(include Params, exclude ...Params) ManagerI

func (*Manager) First

func (manager *Manager) First() Model

func (*Manager) Get

func (manager *Manager) Get(idI any) Model

func (*Manager) IsInstance

func (manager *Manager) IsInstance() bool

func (*Manager) Last

func (manager *Manager) Last() Model

func (*Manager) Table

func (manager *Manager) Table() Table

Jump to

Keyboard shortcuts

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