Documentation
¶
Index ¶
Constants ¶
View Source
const ( TableBattle = "battle" IndexBattleId = "id" IndexBattleAggregateId = "aggregateId" IndexBattlePlayerId = "playerId" )
View Source
const ( IndexMatchId = "id" IndexMatchPlayerId = "playerId" IndexMatchIsWaiting = "isWaiting" )
View Source
const (
TableMatch = "match"
)
Variables ¶
View Source
var BattleTableSchema = &memdb.TableSchema{ Name: TableBattle, Indexes: map[string]*memdb.IndexSchema{ IndexBattleId: { Name: IndexBattleId, Unique: true, Indexer: &memdb.StringFieldIndex{ Field: "Id", }, }, IndexBattleAggregateId: { Name: IndexBattleAggregateId, Unique: true, Indexer: &BattleVersionIndexer{}, }, }, }
View Source
var DefaultSet = wire.NewSet( NewDatabase, )
View Source
var MatchTableSchema = &memdb.TableSchema{ Name: TableMatch, Indexes: map[string]*memdb.IndexSchema{ IndexMatchId: { Name: IndexMatchId, Unique: true, Indexer: &memdb.StringFieldIndex{ Field: "Id", }, }, IndexMatchPlayerId: { Name: IndexMatchPlayerId, Unique: false, Indexer: &MatchPlayerIdIndexer{}, }, IndexMatchIsWaiting: { Name: IndexMatchIsWaiting, Unique: false, Indexer: &memdb.ConditionalIndex{ Conditional: MatchWaitingIndexFunc, }, }, }, }
Functions ¶
func MatchWaitingIndexFunc ¶
Types ¶
type BattleEvent ¶
type BattleVersionIndexer ¶
type BattleVersionIndexer struct{}
func (*BattleVersionIndexer) FromArgs ¶
func (i *BattleVersionIndexer) FromArgs(args ...any) ([]byte, error)
func (*BattleVersionIndexer) FromObject ¶
func (i *BattleVersionIndexer) FromObject(obj any) (bool, [][]byte, error)
type Database ¶
type Database struct { *memdb.MemDB // contains filtered or unexported fields }
func NewDatabase ¶
type Match ¶
type Match struct { Id string Players []MatchPlayer }
type MatchPlayer ¶
type MatchPlayerIdIndexer ¶
type MatchPlayerIdIndexer struct{}
func (*MatchPlayerIdIndexer) FromArgs ¶
func (i *MatchPlayerIdIndexer) FromArgs(args ...interface{}) ([]byte, error)
func (*MatchPlayerIdIndexer) FromObject ¶
func (i *MatchPlayerIdIndexer) FromObject(obj any) (bool, [][]byte, error)
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(watcher *Watcher) *Subscriber
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
Click to show internal directories.
Click to hide internal directories.