Documentation ¶
Index ¶
- Variables
- type Color
- type DeviceTokenType
- type EloResults
- type EloResultsPair
- type EloResultsPlayer
- type EloStateUser
- type EloUpdateState
- type EloUpdater
- type Game
- type GameResults
- type Player
- type SearchUsers
- type SentNotification
- type SentNotificationUpdater
- type Storage
- func (s *Storage) CreateGame(ctx context.Context, game *Game) error
- func (s *Storage) GetActiveGames(ctx context.Context) ([]*Game, error)
- func (s *Storage) GetActiveUsers(ctx context.Context, activityBuffer time.Duration) ([]string, error)
- func (s *Storage) GetGameByPlayerId(ctx context.Context, playerId string) (*Game, error)
- func (s *Storage) GetGamesByUserId(ctx context.Context, userId string, finishedWindow time.Duration) ([]*Game, error)
- func (s *Storage) GetLeaderboard(ctx context.Context, ut UserType, limit int64) ([]*User, error)
- func (s *Storage) GetUserById(ctx context.Context, userId string) (*User, error)
- func (s *Storage) GetUserByNickname(ctx context.Context, nickname string) (*User, error)
- func (s *Storage) SearchUsers(ctx context.Context, req SearchUsers) ([]*User, error)
- func (s *Storage) UpdateDeviceToken(ctx context.Context, userId string, deviceToken []byte, ...) error
- func (s *Storage) UpdateElo(ctx context.Context, updater EloUpdater) error
- func (s *Storage) UpdateGameResults(ctx context.Context, gameId string, results *GameResults) error
- func (s *Storage) UpdateSentNotification(ctx context.Context, userId string, updater SentNotificationUpdater) error
- func (s *Storage) UpdateUser(ctx context.Context, req UpdateUser) (*User, error)
- func (s *Storage) UpsertUser(ctx context.Context, req UpsertUser) error
- type UpdateUser
- type UpsertUser
- type User
- type UserNotificationState
- type UserType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExists = errors.New("already exists") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type DeviceTokenType ¶ added in v0.3.7
type DeviceTokenType string
const ( DeviceTokenTypeSandbox DeviceTokenType = "sdbx" DeviceTokenTypeProduction DeviceTokenType = "prod" )
type EloResults ¶ added in v0.3.16
type EloResults struct { Pairs []EloResultsPair Players []EloResultsPlayer }
func (*EloResults) Scan ¶ added in v0.3.16
func (er *EloResults) Scan(value interface{}) error
type EloResultsPair ¶ added in v0.3.16
type EloResultsPlayer ¶ added in v0.3.16
type EloStateUser ¶ added in v0.3.16
type EloUpdateState ¶ added in v0.3.16
type EloUpdateState struct { Game Game Users []EloStateUser }
type EloUpdater ¶ added in v0.3.16
type EloUpdater func(ctx context.Context, state EloUpdateState) (EloResults, error)
type GameResults ¶ added in v0.3.2
func (*GameResults) Scan ¶ added in v0.3.2
func (r *GameResults) Scan(value interface{}) error
type SearchUsers ¶ added in v0.3.15
type SentNotification ¶ added in v0.3.1
type SentNotification struct {
ActiveGames int `json:"ag"`
}
func (*SentNotification) Scan ¶ added in v0.3.1
func (sn *SentNotification) Scan(value interface{}) error
type SentNotificationUpdater ¶ added in v0.3.1
type SentNotificationUpdater func(ctx context.Context, state UserNotificationState) (UserNotificationState, error)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) CreateGame ¶ added in v0.2.0
func (*Storage) GetActiveGames ¶ added in v0.3.2
func (*Storage) GetActiveUsers ¶ added in v0.3.1
func (*Storage) GetGameByPlayerId ¶ added in v0.3.6
func (*Storage) GetGamesByUserId ¶ added in v0.2.0
func (*Storage) GetLeaderboard ¶ added in v0.3.18
func (*Storage) GetUserById ¶
func (*Storage) GetUserByNickname ¶ added in v0.2.0
func (*Storage) SearchUsers ¶ added in v0.1.3
func (*Storage) UpdateDeviceToken ¶ added in v0.1.3
func (*Storage) UpdateElo ¶ added in v0.3.16
func (s *Storage) UpdateElo(ctx context.Context, updater EloUpdater) error
func (*Storage) UpdateGameResults ¶ added in v0.3.2
func (*Storage) UpdateSentNotification ¶ added in v0.3.1
func (*Storage) UpdateUser ¶ added in v0.0.4
func (*Storage) UpsertUser ¶
func (s *Storage) UpsertUser(ctx context.Context, req UpsertUser) error
type UpdateUser ¶ added in v0.3.15
type UpsertUser ¶ added in v0.3.15
type UserNotificationState ¶ added in v0.3.7
type UserNotificationState struct { DeviceToken []byte DeviceTokenType DeviceTokenType SentNotification SentNotification }
Click to show internal directories.
Click to hide internal directories.