eodb

package
v0.0.0-...-93b4288 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	sync.RWMutex

	Guild string

	Elements []types.Element

	Polls  map[string]types.Poll // map[messageid]poll
	Config *types.ServerConfig

	AI *ai.AI
	// contains filtered or unexported fields
}

func NewDB

func NewDB(guild, path string) (*DB, error)

func (*DB) AddCombo

func (d *DB) AddCombo(elems []int, result int) error

func (*DB) BeginTransaction

func (d *DB) BeginTransaction()

func (*DB) Cats

func (d *DB) Cats() map[string]*types.Category

func (*DB) Close

func (d *DB) Close()

func (*DB) ComboCnt

func (d *DB) ComboCnt() int

func (*DB) Combos

func (d *DB) Combos() map[string]int

func (*DB) CommitTransaction

func (d *DB) CommitTransaction() error

func (*DB) DelCatCache

func (d *DB) DelCatCache(name string) error

func (*DB) DeletePoll

func (d *DB) DeletePoll(poll types.Poll) error

func (*DB) DeleteVCat

func (d *DB) DeleteVCat(name string) error

func (*DB) GetCat

func (d *DB) GetCat(name string) (*types.Category, types.GetResponse)

func (*DB) GetCatCache

func (d *DB) GetCatCache(name string) (map[int]types.Empty, bool)

func (*DB) GetCombo

func (d *DB) GetCombo(elems []int) (int, types.GetResponse)

func (*DB) GetElement

func (d *DB) GetElement(id int, nolock ...bool) (types.Element, types.GetResponse)

func (*DB) GetElementByName

func (d *DB) GetElementByName(name string, nolock ...bool) (types.Element, types.GetResponse)

func (*DB) GetIDByName

func (d *DB) GetIDByName(name string) (int, types.GetResponse)

func (*DB) GetInv

func (d *DB) GetInv(id string) *types.Inventory

func (*DB) GetPoll

func (d *DB) GetPoll(id string) (types.Poll, types.GetResponse)

func (*DB) GetVCat

func (d *DB) GetVCat(name string) (*types.VirtualCategory, types.GetResponse)

func (*DB) Invs

func (d *DB) Invs() map[string]*types.Inventory

func (*DB) NewCat

func (d *DB) NewCat(name string) *types.Category

func (*DB) NewPoll

func (d *DB) NewPoll(poll types.Poll) error

func (*DB) Optimize

func (b *DB) Optimize() error

func (*DB) OptimizeCats

func (b *DB) OptimizeCats() error

func (*DB) Recalc

func (d *DB) Recalc() error

func (*DB) SaveCat

func (d *DB) SaveCat(elems *types.Category) error

func (*DB) SaveCatCache

func (d *DB) SaveCatCache(name string, elems map[int]types.Empty) error

func (*DB) SaveConfig

func (d *DB) SaveConfig() error

func (*DB) SaveElement

func (d *DB) SaveElement(el types.Element, new ...bool) error

func (*DB) SaveInv

func (d *DB) SaveInv(inv *types.Inventory, recalc ...bool) error

func (*DB) SavePoll

func (d *DB) SavePoll(poll types.Poll)

func (*DB) SaveVCat

func (d *DB) SaveVCat(vcat *types.VirtualCategory) error

func (*DB) VCats

func (d *DB) VCats() map[string]*types.VirtualCategory

type Data

type Data struct {
	*sync.RWMutex

	DB   map[string]*DB
	Data map[string]*types.ServerData
	// contains filtered or unexported fields
}

func NewData

func NewData(path string) (*Data, error)

func (*Data) GetDB

func (d *Data) GetDB(guild string) (*DB, types.GetResponse)

func (*Data) GetData

func (d *Data) GetData(guild string) (*types.ServerData, types.GetResponse)

func (*Data) NewDB

func (d *Data) NewDB(guild string) (*DB, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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