Documentation ¶
Index ¶
- type Backend
- func NewBadgerDB(source string, memory bool) (Backend, error)
- func NewBboltDB(source string) (Backend, error)
- func NewBitcaskDB(source string) (Backend, error)
- func NewBoltDB(source string) (Backend, error)
- func NewDiskvDB(source string) (Backend, error)
- func NewGoCache(source string, memory bool) (Backend, error)
- func NewLevelDB(source string) (Backend, error)
- type BadgerBackend
- func (database *BadgerBackend) Count(bucket string) (int, error)
- func (database *BadgerBackend) Create(bucket string, key string, model interface{}) error
- func (database *BadgerBackend) Delete(bucket string, key string) error
- func (database *BadgerBackend) Drop(bucket string) error
- func (database *BadgerBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *BadgerBackend) Read(bucket string, key string, model interface{}) error
- func (database *BadgerBackend) Update(bucket string, key string, model interface{}) error
- type BboltBackend
- func (database *BboltBackend) Count(bucket string) (int, error)
- func (database *BboltBackend) Create(bucket string, key string, model interface{}) error
- func (database *BboltBackend) Delete(bucket string, key string) error
- func (database *BboltBackend) Drop(bucket string) error
- func (database *BboltBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *BboltBackend) Read(bucket string, key string, model interface{}) error
- func (database *BboltBackend) Update(bucket string, key string, model interface{}) error
- type BitcaskBackend
- func (database *BitcaskBackend) Count(bucket string) (int, error)
- func (database *BitcaskBackend) Create(bucket string, key string, model interface{}) error
- func (database *BitcaskBackend) Delete(bucket string, key string) error
- func (database *BitcaskBackend) Drop(bucket string) error
- func (database *BitcaskBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *BitcaskBackend) Read(bucket string, key string, model interface{}) error
- func (database *BitcaskBackend) Update(bucket string, key string, model interface{}) error
- type BoltBackend
- func (database *BoltBackend) Count(bucket string) (int, error)
- func (database *BoltBackend) Create(bucket string, key string, model interface{}) error
- func (database *BoltBackend) Delete(bucket string, key string) error
- func (database *BoltBackend) Drop(bucket string) error
- func (database *BoltBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *BoltBackend) Read(bucket string, key string, model interface{}) error
- func (database *BoltBackend) Update(bucket string, key string, model interface{}) error
- type DiskvBackend
- func (database *DiskvBackend) Count(bucket string) (int, error)
- func (database *DiskvBackend) Create(bucket string, key string, model interface{}) error
- func (database *DiskvBackend) Delete(bucket string, key string) error
- func (database *DiskvBackend) Drop(bucket string) error
- func (database *DiskvBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *DiskvBackend) Read(bucket string, key string, model interface{}) error
- func (database *DiskvBackend) Update(bucket string, key string, model interface{}) error
- type GoCacheBackend
- func (database *GoCacheBackend) Count(bucket string) (int, error)
- func (database *GoCacheBackend) Create(bucket string, key string, model interface{}) error
- func (database *GoCacheBackend) Delete(bucket string, key string) error
- func (database *GoCacheBackend) Drop(bucket string) error
- func (database *GoCacheBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *GoCacheBackend) Read(bucket string, key string, model interface{}) error
- func (database *GoCacheBackend) Update(bucket string, key string, model interface{}) error
- type LevelBackend
- func (database *LevelBackend) Count(bucket string) (int, error)
- func (database *LevelBackend) Create(bucket string, key string, model interface{}) error
- func (database *LevelBackend) Delete(bucket string, key string) error
- func (database *LevelBackend) Drop(bucket string) error
- func (database *LevelBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
- func (database *LevelBackend) Read(bucket string, key string, model interface{}) error
- func (database *LevelBackend) Update(bucket string, key string, model interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Count(bucket string) (int, error) Create(bucket string, key string, model interface{}) error Delete(bucket string, key string) error Drop(bucket string) error Get(bucket string, model interface{}) (*map[string]interface{}, error) Read(bucket string, key string, model interface{}) error Update(bucket string, key string, model interface{}) error }
Backend implements all common backend functions
func NewBadgerDB ¶
NewBadgerDB initialises a new database using the BadgerDB driver
func NewBboltDB ¶
NewBboltDB initialises a new database using the BboltDB driver
func NewBitcaskDB ¶
NewBitcaskDB initialises a new database using the BitcaskDB driver
func NewDiskvDB ¶
NewDiskvDB initialises a new database using the DiskvDB driver
func NewGoCache ¶
NewGoCache initialises a new database using the GoCache driver
func NewLevelDB ¶
NewLevelDB initialises a new database using the LevelDB driver
type BadgerBackend ¶
BadgerBackend acts as a wrapper around a Backend interface
func (*BadgerBackend) Count ¶
func (database *BadgerBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*BadgerBackend) Create ¶
func (database *BadgerBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*BadgerBackend) Delete ¶
func (database *BadgerBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*BadgerBackend) Drop ¶
func (database *BadgerBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*BadgerBackend) Get ¶
func (database *BadgerBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type BboltBackend ¶
BboltBackend acts as a wrapper around a Backend interface
func (*BboltBackend) Count ¶
func (database *BboltBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*BboltBackend) Create ¶
func (database *BboltBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*BboltBackend) Delete ¶
func (database *BboltBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*BboltBackend) Drop ¶
func (database *BboltBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*BboltBackend) Get ¶
func (database *BboltBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type BitcaskBackend ¶
BitcaskBackend acts as a wrapper around a Backend interface
func (*BitcaskBackend) Count ¶
func (database *BitcaskBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*BitcaskBackend) Create ¶
func (database *BitcaskBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*BitcaskBackend) Delete ¶
func (database *BitcaskBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*BitcaskBackend) Drop ¶
func (database *BitcaskBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*BitcaskBackend) Get ¶
func (database *BitcaskBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type BoltBackend ¶
BoltBackend acts as a wrapper around a Backend interface
func (*BoltBackend) Count ¶
func (database *BoltBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*BoltBackend) Create ¶
func (database *BoltBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*BoltBackend) Delete ¶
func (database *BoltBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*BoltBackend) Drop ¶
func (database *BoltBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*BoltBackend) Get ¶
func (database *BoltBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type DiskvBackend ¶
DiskvBackend acts as a wrapper around a Backend interface
func (*DiskvBackend) Count ¶
func (database *DiskvBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*DiskvBackend) Create ¶
func (database *DiskvBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*DiskvBackend) Delete ¶
func (database *DiskvBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*DiskvBackend) Drop ¶
func (database *DiskvBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*DiskvBackend) Get ¶
func (database *DiskvBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type GoCacheBackend ¶
type GoCacheBackend struct { Backend Connection *cache.Cache Memory bool Mux sync.RWMutex Source string }
GoCacheBackend acts as a wrapper around a Backend interface
func (*GoCacheBackend) Count ¶
func (database *GoCacheBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*GoCacheBackend) Create ¶
func (database *GoCacheBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*GoCacheBackend) Delete ¶
func (database *GoCacheBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*GoCacheBackend) Drop ¶
func (database *GoCacheBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*GoCacheBackend) Get ¶
func (database *GoCacheBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket
type LevelBackend ¶
LevelBackend acts as a wrapper around a Backend interface
func (*LevelBackend) Count ¶
func (database *LevelBackend) Count(bucket string) (int, error)
Count returns the total number of records inside of the provided bucket
func (*LevelBackend) Create ¶
func (database *LevelBackend) Create(bucket string, key string, model interface{}) error
Create inserts a record into the backend
func (*LevelBackend) Delete ¶
func (database *LevelBackend) Delete(bucket string, key string) error
Delete removes a record from the backend
func (*LevelBackend) Drop ¶
func (database *LevelBackend) Drop(bucket string) error
Drop deletes a bucket (and all of its contents) from the backend
func (*LevelBackend) Get ¶
func (database *LevelBackend) Get(bucket string, model interface{}) (*map[string]interface{}, error)
Get returns all records inside of the provided bucket