badgerdb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerDB

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

func NewBadgerDB

func NewBadgerDB(opts badger.Options) *BadgerDB

func (*BadgerDB) AsManagerDB

func (d *BadgerDB) AsManagerDB() manager.DB

func (*BadgerDB) AsTelegramDB

func (d *BadgerDB) AsTelegramDB() telegram.DB

func (*BadgerDB) Begin

func (d *BadgerDB) Begin(mode db.TxMode) (*BadgerTx, error)

func (*BadgerDB) Close

func (d *BadgerDB) Close() error

func (*BadgerDB) Init

func (d *BadgerDB) Init() error

type BadgerTx

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

func (*BadgerTx) Commit

func (t *BadgerTx) Commit() error

func (*BadgerTx) CreateChatLongRunningCommand

func (t *BadgerTx) CreateChatLongRunningCommand(chatID int64, command string) (string, error)

func (*BadgerTx) CreateChatState

func (t *BadgerTx) CreateChatState(chatID int64, chatState telegram.ChatState) (telegram.ChatState, error)

func (*BadgerTx) CreateSubnet

func (t *BadgerTx) CreateSubnet(subnet *manager.Subnet) (*manager.Subnet, error)

func (*BadgerTx) DeleteChatLongRunningCommand

func (t *BadgerTx) DeleteChatLongRunningCommand(chatID int64) error

func (*BadgerTx) DeleteChatState

func (t *BadgerTx) DeleteChatState(chatID int64) error

func (*BadgerTx) DeleteSubnet

func (t *BadgerTx) DeleteSubnet(id uuid.UUID) error

func (*BadgerTx) DumpData

func (t *BadgerTx) DumpData() ([]byte, error)

func (*BadgerTx) GetChatLongRunningCommand

func (t *BadgerTx) GetChatLongRunningCommand(chatID int64) (string, error)

func (*BadgerTx) GetChatState

func (t *BadgerTx) GetChatState(chatID int64) (telegram.ChatState, error)

func (*BadgerTx) GetOrCreateDeviceName

func (t *BadgerTx) GetOrCreateDeviceName(defaultDeviceName string) (string, error)

func (*BadgerTx) GetSubnet

func (t *BadgerTx) GetSubnet(id uuid.UUID) (*manager.Subnet, error)

func (*BadgerTx) GetSubnetCIDRs

func (t *BadgerTx) GetSubnetCIDRs() ([]*net.IPNet, error)

func (*BadgerTx) LoadData

func (t *BadgerTx) LoadData(data []byte) error

func (*BadgerTx) Rollback

func (t *BadgerTx) Rollback()

func (*BadgerTx) UpdateChatLongRunningCommand

func (t *BadgerTx) UpdateChatLongRunningCommand(chatID int64, command string) (string, error)

func (*BadgerTx) UpdateChatState

func (t *BadgerTx) UpdateChatState(chatID int64, chatState telegram.ChatState) (telegram.ChatState, error)

Jump to

Keyboard shortcuts

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