Documentation
¶
Overview ¶
Package badger provides a wrapper functions for Badger database interactions.
REQUIRED VARIABLES: (SET ON INIT)
DataDir string OptionsDir string TimeZone string LogPrefix string EncryptionKey string
Example:
func badgerInit() {
c.Get(globals.ConfigFile)
badger.DataDir = c.Badger.DataDir
badger.OptionsDir = c.Badger.OptionsDir
badger.TimeZone = c.TimeZone
badger.LogPrefix = c.LogPrefix
badger.EncryptionKey = globals.EncryptionKey
badger.EncryptionIV = globals.EncryptionIV
}
Index ¶
- Variables
- func DBConnectionInit() error
- type Command
- type CommandsRepository
- func (b *CommandsRepository) Close() error
- func (b *CommandsRepository) Delete(k []byte) error
- func (b *CommandsRepository) Get(k []byte) ([]byte, error)
- func (b *CommandsRepository) GetAll() ([]Command, error)
- func (b *CommandsRepository) Iterate(prefix []byte) ([]Command, error)
- func (b *CommandsRepository) Set(k, v []byte) error
- type Repository
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DBConnectionInit ¶
func DBConnectionInit() error
Types ¶
type CommandsRepository ¶
type CommandsRepository struct {
// contains filtered or unexported fields
}
func GetDB ¶
func GetDB() *CommandsRepository
func NewCommandsRepository ¶
func NewCommandsRepository(dbPath string) (*CommandsRepository, error)
func (*CommandsRepository) Close ¶
func (b *CommandsRepository) Close() error
func (*CommandsRepository) Delete ¶
func (b *CommandsRepository) Delete(k []byte) error
func (*CommandsRepository) GetAll ¶
func (b *CommandsRepository) GetAll() ([]Command, error)
func (*CommandsRepository) Iterate ¶
func (b *CommandsRepository) Iterate(prefix []byte) ([]Command, error)
func (*CommandsRepository) Set ¶
func (b *CommandsRepository) Set(k, v []byte) error
Click to show internal directories.
Click to hide internal directories.