Documentation ¶
Index ¶
- type Database
- type DynamoDBDatabase
- func (ddb *DynamoDBDatabase) ReadScores() (scores []Score, err error)
- func (ddb *DynamoDBDatabase) ReadScoresByType(scoreType string) (scores []Score, err error)
- func (ddb *DynamoDBDatabase) ReadServers() (servers []Server, err error)
- func (ddb *DynamoDBDatabase) ReadServersByRegion(region string) (servers []Server, err error)
- func (ddb *DynamoDBDatabase) UpdateScore(score Score) error
- func (ddb *DynamoDBDatabase) UpdateServer(server Server) error
- func (ddb *DynamoDBDatabase) UpdateStatistic(statistic Statistic) error
- type Score
- type Server
- type Statistic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { UpdateScore(score Score) error ReadScores() (scores []Score, err error) ReadScoresByType(scoreType string) (scores []Score, err error) UpdateServer(server Server) error UpdateStatistic(statistic Statistic) error ReadServers() (servers []Server, err error) ReadServersByRegion(region string) (servers []Server, err error) }
type DynamoDBDatabase ¶
type DynamoDBDatabase struct {
// contains filtered or unexported fields
}
func NewDynamoDBDatabase ¶
func NewDynamoDBDatabase(session *session.Session, stage string) (*DynamoDBDatabase, error)
func (*DynamoDBDatabase) ReadScores ¶
func (ddb *DynamoDBDatabase) ReadScores() (scores []Score, err error)
func (*DynamoDBDatabase) ReadScoresByType ¶
func (ddb *DynamoDBDatabase) ReadScoresByType(scoreType string) (scores []Score, err error)
func (*DynamoDBDatabase) ReadServers ¶
func (ddb *DynamoDBDatabase) ReadServers() (servers []Server, err error)
func (*DynamoDBDatabase) ReadServersByRegion ¶
func (ddb *DynamoDBDatabase) ReadServersByRegion(region string) (servers []Server, err error)
func (*DynamoDBDatabase) UpdateScore ¶
func (ddb *DynamoDBDatabase) UpdateScore(score Score) error
func (*DynamoDBDatabase) UpdateServer ¶
func (ddb *DynamoDBDatabase) UpdateServer(server Server) error
func (*DynamoDBDatabase) UpdateStatistic ¶
func (ddb *DynamoDBDatabase) UpdateStatistic(statistic Statistic) error
type Statistic ¶
type Statistic struct { Region string `dynamo:"region"` // Unix millis; should be aligned to the hour Timestamp int64 `dynamo:"timestamp"` // Atomic counters Plays int `dynamo:"plays"` // i.e. each spawn Players int `dynamo:"players"` // i.e. each connection NewPlayers int `dynamo:"newPlayers"` // i.e. each "new" spawn }
Click to show internal directories.
Click to hide internal directories.