Documentation ¶
Index ¶
- func KeyPlayerIds(ids [2]int) (key []byte)
- func KeyPlayers(game *bat.Game) (b []byte)
- func KeyPlayersTime(game *bat.Game) (key []byte)
- func KeyTimePlayers(game *bat.Game) (key []byte)
- type Db
- func (bdb *Db) BackupHandleFunc(w http.ResponseWriter, req *http.Request)
- func (bdb *Db) Get(key []byte) (game *bat.Game, err error)
- func (bdb *Db) Gets(keys [][]byte) (games []*bat.Game, err error)
- func (bdb *Db) Init() error
- func (bdb *Db) MaxFetchNo() int
- func (bdb *Db) Put(game *bat.Game) (key []byte, err error)
- func (bdb *Db) Puts(games []*bat.Game) (keys [][]byte, err error)
- func (bdb *Db) ScannPrefix(filterF func(game *bat.Game, key []byte) bool, prefix []byte) (games []*bat.Game, isMaxFetch bool, err error)
- func (bdb *Db) ScannStartEnd(filterF func(game *bat.Game, key []byte) bool, start []byte, end []byte) (games []*bat.Game, isMaxFetch bool, err error)
- func (bdb *Db) Search(filterF func(game *bat.Game, key []byte) bool) (games []*bat.Game, nextKey []byte, err error)
- func (bdb *Db) SearchLoop(filterF func(game *bat.Game, key []byte) bool, startKey []byte) (games []*bat.Game, nextKey []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyPlayerIds ¶
KeyPlayerIds define a key as player ids where the smalles player id comes first.
func KeyPlayers ¶
KeyPlayers define a key as player ids where the smalles player id comes first.
func KeyPlayersTime ¶
KeyPlayersTime define a key as timestamp 2006-01-02T15:04:05Z07:00 plus player ids where the smalles player id comes first.
func KeyTimePlayers ¶
KeyTimePlayers define a key as player ids where the smalles player id comes first plus timestamp 2006-01-02T15:04:05Z07:00.
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db is a battleline database
func (*Db) BackupHandleFunc ¶
func (bdb *Db) BackupHandleFunc(w http.ResponseWriter, req *http.Request)
func (*Db) MaxFetchNo ¶
func (*Db) ScannPrefix ¶
func (bdb *Db) ScannPrefix( filterF func(game *bat.Game, key []byte) bool, prefix []byte) (games []*bat.Game, isMaxFetch bool, err error)
ScannPrefix makes a prefix scann.
func (*Db) ScannStartEnd ¶
func (bdb *Db) ScannStartEnd( filterF func(game *bat.Game, key []byte) bool, start []byte, end []byte) (games []*bat.Game, isMaxFetch bool, err error)
ScannStartEnd scans a interval of keys. The keys must be bytes comparable and the start key must exist.
Click to show internal directories.
Click to hide internal directories.