Documentation ¶
Overview ¶
Package db implements simple method of treatment to bbolt db.
Index ¶
- Constants
- func GetNameBucket(model Model) string
- func Open(path string) (*DataBase, Error)
- type Bucket
- func (bucket *Bucket) Count() uint
- func (bucket *Bucket) DB() DB
- func (bucket *Bucket) Delete(keyI any) Error
- func (bucket *Bucket) DeleteAll() Error
- func (bucket *Bucket) Get(keyI any) (Model, Error)
- func (bucket *Bucket) Manager() ManagerI
- func (bucket *Bucket) Model() Model
- func (bucket *Bucket) Name() string
- func (bucket *Bucket) Save(model Model) Error
- type DataBase
- type Manager
- func (manager *Manager) All() []Model
- func (manager *Manager) CheckModel(model Model, include Params, exclude ...Params) bool
- func (manager *Manager) CheckPointers(model Model)
- func (manager *Manager) Copy() ManagerI
- func (manager *Manager) Count() uint
- func (manager *Manager) Delete(id any)
- func (manager *Manager) Filter(include Params, exclude ...Params) ManagerI
- func (manager *Manager) First() Model
- func (manager *Manager) Get(idI any) Model
- func (manager *Manager) IsInstance() bool
- func (manager *Manager) Last() Model
- func (manager *Manager) Table() Table
Constants ¶
View Source
const DELETE = "DELETE"
Variables ¶
This section is empty.
Functions ¶
func GetNameBucket ¶ added in v0.12.0
func GetNameBucket(model Model) string
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) DeleteAll ¶
func (bucket *Bucket) DeleteAll() Error
DeleteAll implements Deleting all values in bucket.
type DataBase ¶
type DataBase struct {
// contains filtered or unexported fields
}
DataBase implements interface access to bbolt db.
func (*DataBase) Close ¶
func (db *DataBase) Close() Error
Close implements access to close DataBase.
func (*DataBase) ExistsTable ¶
ExistsBucket returns true if bucket exists.
func (*DataBase) Table ¶
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
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) CheckModel ¶
func (*Manager) CheckPointers ¶ added in v0.12.0
func (manager *Manager) CheckPointers(model Model)
func (*Manager) IsInstance ¶
Click to show internal directories.
Click to hide internal directories.