Versions in this module Expand all Collapse all v0 v0.1.0 Feb 27, 2020 Changes in this version + const AllocateNationsRoute + const ConfigureRoute + const DevResolvePhaseTimeoutRoute + const DevUserStatsUpdateRoute + const GetMainJSRoute + const GetSWJSRoute + const GlobalStatsRoute + const IndexRoute + const ListBansRoute + const ListChannelsRoute + const ListFinishedGamesRoute + const ListFlaggedMessagesRoute + const ListGameStatesRoute + const ListMessagesRoute + const ListMyFinishedGamesRoute + const ListMyStagingGamesRoute + const ListMyStartedGamesRoute + const ListOpenGamesRoute + const ListOptionsRoute + const ListOrdersRoute + const ListOtherFinishedGamesRoute + const ListOtherStagingGamesRoute + const ListOtherStartedGamesRoute + const ListPhaseStatesRoute + const ListPhasesRoute + const ListStartedGamesRoute + const ListTopHatedPlayersRoute + const ListTopHaterPlayersRoute + const ListTopQuickPlayersRoute + const ListTopRatedPlayersRoute + const ListTopReliablePlayersRoute + const MAX_PHASE_DEADLINE + const MAX_STAGING_GAME_INACTIVITY + const ReRateRoute + const ReScheduleAllBrokenRoute + const ReScheduleRoute + const ReapInactiveWaitingPlayersRoute + const ReceiveMailRoute + const RenderPhaseMapRoute + const ResaveRoute + const RssRoute + var AllocationResource *Resource + var BanResource *Resource + var FlaggedMessagesResource *Resource + var GameResource *Resource + var GameResultResource = &Resource + var GameStateResource *Resource + var MemberResource = &Resource + var MessageFlagResource *Resource + var MessageResource *Resource + var OrderResource *Resource + var PhaseResource *Resource + var PhaseResultResource = &Resource + var PhaseStateResource *Resource + var UpdateUserStatsFunc *DelayFunc + var UserStatsResource *Resource + func Allocate(preferers Preferers, nations godip.Nations) ([]godip.Nation, error) + func BanID(ctx context.Context, userIds []string) (*datastore.Key, error) + func ChannelID(ctx context.Context, gameID *datastore.Key, members Nations) (*datastore.Key, error) + func FlaggedMessagesID(ctx context.Context, gameID *datastore.Key, userId string) (*datastore.Key, error) + func GameResultID(ctx context.Context, gameID *datastore.Key) *datastore.Key + func GameStateID(ctx context.Context, gameID *datastore.Key, nation godip.Nation) (*datastore.Key, error) + func OrderID(ctx context.Context, phaseID *datastore.Key, srcProvince godip.Province) (*datastore.Key, error) + func PP(i interface{}) string + func PhaseID(ctx context.Context, gameID *datastore.Key, phaseOrdinal int64) (*datastore.Key, error) + func PhaseResultID(ctx context.Context, gameID *datastore.Key, phaseOrdinal int64) (*datastore.Key, error) + func PhaseStateID(ctx context.Context, phaseID *datastore.Key, nation godip.Nation) (*datastore.Key, error) + func SeenMarkerID(ctx context.Context, channelID *datastore.Key, owner godip.Nation) (*datastore.Key, error) + func SetFCMConf(ctx context.Context, fcmConf *FCMConf) error + func SetSendGrid(ctx context.Context, sendGrid *SendGrid) error + func SetupRouter(r *mux.Router) + func UpdateGlickosASAP(ctx context.Context) error + func UpdateUserStatsASAP(ctx context.Context, uids []string) error + func UserStatsID(ctx context.Context, userId string) *datastore.Key + type Allocation struct + Members AllocationMembers + Variant string + func (a *Allocation) Item(r Request) *Item + type AllocationMember struct + Prefs godip.Nations + Result godip.Nation + func (a AllocationMember) Preferences() godip.Nations + type AllocationMembers []AllocationMember + func (a AllocationMembers) Each(f func(int, Preferer)) + func (a AllocationMembers) Len() int + type AllocationMethod int + const PreferenceAllocation + const RandomAllocation + type Ban struct + OwnerIds []string + UserIds []string + Users []auth.User + func (b *Ban) ID(ctx context.Context) (*datastore.Key, error) + func (b *Ban) Item(r Request) *Item + func (b *Ban) OwnedBy(uid string) bool + func (b *Ban) Save(ctx context.Context) error + type Bans []Ban + func (b Bans) Item(r Request, userId string) *Item + type Bounce struct + BounceList string + Province godip.Province + type Channel struct + GameID *datastore.Key + Members Nations + NMessages int + NMessagesSince NMessagesSince + func (c *Channel) CountSince(ctx context.Context, since time.Time) error + func (c *Channel) ID(ctx context.Context) (*datastore.Key, error) + func (c *Channel) Item(r Request) *Item + type Channels []Channel + func (c Channels) Item(r Request, gameID *datastore.Key, isMember bool) *Item + type DelayFunc struct + var FCMSendToTokensFunc *DelayFunc + func NewDelayFunc(queue string, backend interface{}) *DelayFunc + func (d *DelayFunc) EnqueueAt(ctx context.Context, taskETA time.Time, args ...interface{}) error + func (d *DelayFunc) EnqueueIn(ctx context.Context, taskDelay time.Duration, args ...interface{}) error + type Diplicity struct + User *auth.User + type Dislodged struct + Dislodged godip.Unit + Province godip.Province + type Dislodger struct + Dislodger godip.Province + Province godip.Province + type FCMConf struct + ServerKey string + type FCMData struct + DiplicityJSON []byte + func NewFCMData(payload interface{}) (*FCMData, error) + type FlaggedMessage struct + AuthorId string + Body string + ChannelMembers string + CreatedAt time.Time + GameID *datastore.Key + Sender godip.Nation + type FlaggedMessages struct + CreatedAt time.Time + GameID *datastore.Key + Messages []FlaggedMessage + UserId string + func (f *FlaggedMessages) Item(r Request) *Item + type FlaggedMessagess []FlaggedMessages + func (f FlaggedMessagess) Item(r Request, curs *datastore.Cursor, limit int, userId string) *Item + type Game struct + ActiveBans []Ban + Closed bool + CreatedAgo time.Duration + CreatedAt time.Time + Desc string + DisableConferenceChat bool + DisableGroupChat bool + DisablePrivateChat bool + FailedRequirements []string + Finished bool + FinishedAgo time.Duration + FinishedAt time.Time + FirstMember *Member + ID *datastore.Key + MaxHated float64 + MaxHater float64 + MaxRating float64 + Members Members + MinQuickness float64 + MinRating float64 + MinReliability float64 + NMembers int + NationAllocation AllocationMethod + NewestPhaseMeta []PhaseMeta + NoMerge bool + PhaseLengthMinutes time.Duration + Private bool + StartETA time.Time + Started bool + StartedAgo time.Duration + StartedAt time.Time + Variant string + func (g *Game) AbbrNat(nat godip.Nation) godip.Nation + func (g *Game) AbbrNats(nats Nations) Nations + func (g *Game) DescFor(nat godip.Nation) string + func (g *Game) GetMemberByNation(nation godip.Nation) (*Member, bool) + func (g *Game) GetMemberByUserId(userID string) (*Member, bool) + func (g *Game) Item(r Request) *Item + func (g *Game) Joinable() bool + func (g *Game) Leavable() bool + func (g *Game) Redact(viewer *auth.User) + func (g *Game) Refresh() + func (g *Game) Save(ctx context.Context) error + type GameResult struct + AllUsers []string + CreatedAt time.Time + DIASMembers []godip.Nation + DIASUsers []string + EliminatedMembers []godip.Nation + EliminatedUsers []string + GameID *datastore.Key + NMRMembers []godip.Nation + NMRUsers []string + Private bool + Rated bool + Scores []GameScore + SoloWinnerMember godip.Nation + SoloWinnerUser string + func (g *GameResult) AssignScores() + func (g *GameResult) ID(ctx context.Context) *datastore.Key + func (g *GameResult) Item(r Request) *Item + func (g *GameResult) Save(ctx context.Context) error + type GameResults []GameResult + type GameScore struct + Member godip.Nation + SCs int + Score float64 + UserId string + type GameState struct + GameID *datastore.Key + Muted []godip.Nation + Nation godip.Nation + func (g *GameState) HasMuted(nat godip.Nation) bool + func (g *GameState) ID(ctx context.Context) (*datastore.Key, error) + func (g *GameState) Save(ctx context.Context) error + func (p *GameState) Item(r Request) *Item + type GameStates []GameState + func (g GameStates) Item(r Request, gameID *datastore.Key) *Item + type Games []Game + func (g *Games) RemoveBanned(ctx context.Context, uid string) ([][]Ban, error) + func (g *Games) RemoveCustomFiltered(filters []func(g *Game) bool) + func (g *Games) RemoveFiltered(userStats *UserStats) [][]string + func (g Games) Item(r Request, user *auth.User, cursor *datastore.Cursor, limit int, name string, ...) *Item + func (g Games) Len() int + func (g Games) Less(i, j int) bool + func (g Games) Swap(i, j int) + type Glicko struct + CreatedAt time.Time + Deviation float64 + GameID *datastore.Key + Member godip.Nation + PracticalRating float64 + Rating float64 + UserId string + Volatility float64 + func GetGlicko(ctx context.Context, userId string) (*Glicko, error) + func (g *Glicko) ID(ctx context.Context) (*datastore.Key, error) + type GlobalStats struct + ActiveGameHistograms map[string]Histogram + ActiveGameMemberUserStatsHistograms map[string]Histogram + ActiveMemberUserStatsHistograms map[string]Histogram + type Histogram struct + Data map[string]int + Description string + type Member struct + GameAlias string + Nation godip.Nation + NationPreferences string + NewestPhaseState PhaseState + UnreadMessages int + User auth.User + func (m *Member) Item(r Request) *Item + func (m *Member) Redact(viewer *auth.User, isMember bool, started bool) + func (m Member) Preferences() godip.Nations + type Members []Member + func (m Members) Each(f func(int, Preferer)) + func (m Members) Len() int + type Message struct + Age time.Duration + Body string + ChannelMembers Nations + CreatedAt time.Time + GameID *datastore.Key + ID *datastore.Key + Sender godip.Nation + func (m *Message) Item(r Request) *Item + func (m *Message) NotifyRecipients(ctx context.Context, host string, channel *Channel, game *Game) error + type MessageFlag struct + ChannelMembers Nations + From time.Time + GameID *datastore.Key + To time.Time + func (m *MessageFlag) Item(r Request) *Item + type Messages []Message + func (m Messages) Item(r Request, gameID *datastore.Key, channelMembers Nations) *Item + type NMessagesSince struct + NMessages int + Since time.Time + type Nations []godip.Nation + func (n *Nations) FromString(s string) + func (n Nations) Includes(m godip.Nation) bool + func (n Nations) Len() int + func (n Nations) Less(i, j int) bool + func (n Nations) String() string + func (n Nations) Swap(i, j int) + type Order struct + GameID *datastore.Key + Nation godip.Nation + Parts []string + PhaseOrdinal int64 + func (o *Order) ID(ctx context.Context) (*datastore.Key, error) + func (o *Order) Item(r Request) *Item + func (o *Order) Save(ctx context.Context) error + type Orders []Order + func (o Orders) Item(r Request, gameID *datastore.Key, phase *Phase) *Item + type Phase struct + Bounces []Bounce + Dislodgeds []Dislodged + Dislodgers []Dislodger + GameID *datastore.Key + Host string + Resolutions []Resolution + SCs []SC + Scheme string + Units []UnitWrapper + func NewPhase(s *state.State, gameID *datastore.Key, phaseOrdinal int64, host string) *Phase + func (p *Phase) ID(ctx context.Context) (*datastore.Key, error) + func (p *Phase) Item(r Request) *Item + func (p *Phase) Orders(ctx context.Context) (map[godip.Nation]map[godip.Province][]string, error) + func (p *Phase) Recalc() error + func (p *Phase) Save(ctx context.Context) error + func (p *Phase) ScheduleResolution(ctx context.Context) error + func (p *Phase) State(ctx context.Context, variant vrt.Variant, ...) (*state.State, error) + type PhaseMeta struct + CreatedAgo time.Duration + CreatedAt time.Time + DeadlineAt time.Time + NextDeadlineIn time.Duration + PhaseOrdinal int64 + Resolved bool + ResolvedAgo time.Duration + ResolvedAt time.Time + SCsJSON string + Season godip.Season + Type godip.PhaseType + UnitsJSON string + Year int + func (p *PhaseMeta) Refresh() + type PhaseResolver struct + Context context.Context + Game *Game + Phase *Phase + PhaseStates PhaseStates + TimeoutTriggered bool + func (p *PhaseResolver) Act() error + func (p *PhaseResolver) SCCounts(s *state.State) map[godip.Nation]int + type PhaseResult struct + ActiveUsers []string + AllUsers []string + GameID *datastore.Key + NMRUsers []string + PhaseOrdinal int64 + Private bool + ReadyUsers []string + func (p *PhaseResult) ID(ctx context.Context) (*datastore.Key, error) + func (p *PhaseResult) Item(r Request) *Item + func (p *PhaseResult) Save(ctx context.Context) error + type PhaseState struct + Eliminated bool + GameID *datastore.Key + Nation godip.Nation + NoOrders bool + Note string + OnProbation bool + PhaseOrdinal int64 + ReadyToResolve bool + WantsDIAS bool + ZippedOptions []byte + func (p *PhaseState) ID(ctx context.Context) (*datastore.Key, error) + func (p *PhaseState) Item(r Request) *Item + func (p *PhaseState) Save(ctx context.Context) error + type PhaseStates []PhaseState + func (p PhaseStates) Item(r Request, phase *Phase) *Item + type Phases []Phase + func (p Phases) Item(r Request, gameID *datastore.Key) *Item + func (p Phases) Len() int + func (p Phases) Less(i, j int) bool + func (p Phases) Swap(i, j int) + type Preferer interface + Preferences func() godip.Nations + type Preferers interface + Each func(func(int, Preferer)) + Len func() int + type Resolution struct + Province godip.Province + Resolution string + type SC struct + Owner godip.Nation + Province godip.Province + type SeenMarker struct + At time.Time + GameID *datastore.Key + Members Nations + Owner godip.Nation + func (s *SeenMarker) ID(ctx context.Context) (*datastore.Key, error) + type SendGrid struct + APIKey string + func GetSendGrid(ctx context.Context) (*SendGrid, error) + type UnitWrapper struct + Province godip.Province + Unit godip.Unit + type UserStats struct + Glicko Glicko + PrivateStats UserStatsNumbers + User auth.User + UserId string + func (u *UserStats) ID(ctx context.Context) *datastore.Key + func (u *UserStats) Item(r Request) *Item + func (u *UserStats) Redact() + type UserStatsNumbers struct + ActivePhases int + DIASGames int + DroppedGames int + EliminatedGames int + FinishedGames int + Hated float64 + Hater float64 + NMRPhases int + OwnedBans int + Quickness float64 + ReadyPhases int + Reliability float64 + SharedBans int + SoloGames int + StartedGames int + func (u *UserStatsNumbers) Recalculate(ctx context.Context, private bool, userId string) error + type UserStatsSlice []UserStats + func (u UserStatsSlice) Item(r Request, cursor *datastore.Cursor, limit int64, name string, desc []string, ...) *Item