Documentation ¶
Index ¶
- Constants
- func KeyPlayerIDs(ids [2]int) (key []byte)
- func KeyPlayers(hist *game.Hist) (b []byte)
- func KeyPlayersTime(hist *game.Hist) (key []byte)
- func KeyTimePlayers(hist *game.Hist) (key []byte)
- type Db
- func (bdb *Db) BackupHandleFunc(w http.ResponseWriter, req *http.Request)
- func (bdb *Db) Close() error
- func (bdb *Db) Delete(key []byte) (err error)
- func (bdb *Db) Get(key []byte) (hist *game.Hist, err error)
- func (bdb *Db) Gets(keys [][]byte) (hists []*game.Hist, err error)
- func (bdb *Db) Init() error
- func (bdb *Db) Key(hist *game.Hist) []byte
- func (bdb *Db) MaxFetchNo() int
- func (bdb *Db) Put(hist *game.Hist) (err error)
- func (bdb *Db) Puts(hists []*game.Hist) (err error)
- func (bdb *Db) ScannPrefix(filterFunc func(hist *game.Hist) bool, prefix []byte) (hists []*game.Hist, isMaxFetch bool, err error)
- func (bdb *Db) ScannStartEnd(filterFunc func(game *game.Hist) bool, start []byte, end []byte) (hists []*game.Hist, isMaxFetch bool, err error)
- func (bdb *Db) Search(filterFunc func(hist *game.Hist) bool, startKey []byte) (hists []*game.Hist, nextKey []byte, err error)
Constants ¶
View Source
const (
//TimeFormat is the RFC3339Nano with trailing zeros.
TimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
)
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:05.000000000Z07: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:05.000000000Z07: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)
BackupHandleFunc handles http back up requests.
func (*Db) MaxFetchNo ¶
MaxFetchNo returns the max. number of records fetched in search.
func (*Db) ScannPrefix ¶
func (bdb *Db) ScannPrefix( filterFunc func(hist *game.Hist) bool, prefix []byte) (hists []*game.Hist, isMaxFetch bool, err error)
ScannPrefix makes a prefix scann.
Click to show internal directories.
Click to hide internal directories.