Documentation ¶
Index ¶
- Constants
- type Cache
- func (c *Cache) ActiveTournamentsFor(ctx context.Context, userID string) ([][2]string, error)
- func (c *Cache) AddRegistrants(ctx context.Context, tid string, userIDs []string, division string) error
- func (c *Cache) Create(ctx context.Context, tm *entity.Tournament) error
- func (c *Cache) Disconnect()
- func (c *Cache) Get(ctx context.Context, id string) (*entity.Tournament, error)
- func (c *Cache) GetBySlug(ctx context.Context, id string) (*entity.Tournament, error)
- func (c *Cache) GetRecentClubSessions(ctx context.Context, clubID string, numSessions int, offset int) (*pb.ClubSessionsResponse, error)
- func (c *Cache) GetRecentGames(ctx context.Context, tourneyID string, numGames int, offset int) (*pb.RecentGamesResponse, error)
- func (c *Cache) ListAllIDs(ctx context.Context) ([]string, error)
- func (c *Cache) RemoveRegistrants(ctx context.Context, tid string, userIDs []string, division string) error
- func (c *Cache) RemoveRegistrantsForTournament(ctx context.Context, tid string) error
- func (c *Cache) Set(ctx context.Context, tm *entity.Tournament) error
- func (c *Cache) SetTournamentEventChan(ch chan<- *entity.EventWrapper)
- func (c *Cache) TournamentEventChan() chan<- *entity.EventWrapper
- func (c *Cache) Unload(ctx context.Context, id string)
- type DBStore
- func (s *DBStore) ActiveTournamentsFor(ctx context.Context, userID string) ([][2]string, error)
- func (s *DBStore) AddRegistrants(ctx context.Context, tid string, userIDs []string, division string) error
- func (s *DBStore) Create(ctx context.Context, tm *entity.Tournament) error
- func (s *DBStore) Disconnect()
- func (s *DBStore) Get(ctx context.Context, id string) (*entity.Tournament, error)
- func (s *DBStore) GetBySlug(ctx context.Context, slug string) (*entity.Tournament, error)
- func (s *DBStore) GetRecentClubSessions(ctx context.Context, id string, count int, offset int) (*pb.ClubSessionsResponse, error)
- func (s *DBStore) GetRecentGames(ctx context.Context, tourneyID string, numGames int, offset int) (*pb.RecentGamesResponse, error)
- func (s *DBStore) ListAllIDs(ctx context.Context) ([]string, error)
- func (s *DBStore) RemoveRegistrants(ctx context.Context, tid string, userIDs []string, division string) error
- func (s *DBStore) RemoveRegistrantsForTournament(ctx context.Context, tid string) error
- func (s *DBStore) Set(ctx context.Context, tm *entity.Tournament) error
- func (s *DBStore) SetTournamentEventChan(c chan<- *entity.EventWrapper)
- func (s *DBStore) TournamentEventChan() chan<- *entity.EventWrapper
Constants ¶
const ( // Increase this if we ever think we might be holding more than // 50 tournaments at a time. CacheCap = 50 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache will reside in-memory, and will be per-node.
func (*Cache) ActiveTournamentsFor ¶
func (*Cache) AddRegistrants ¶
func (*Cache) Disconnect ¶
func (c *Cache) Disconnect()
func (*Cache) Get ¶
Get gets a tournament from the cache. It loads it into the cache if it's not there.
func (*Cache) GetRecentClubSessions ¶
func (*Cache) GetRecentGames ¶
func (*Cache) RemoveRegistrants ¶
func (*Cache) RemoveRegistrantsForTournament ¶
func (*Cache) Set ¶
Set sets a tournament in the cache, AND in the backing store. This ensures if the node crashes the tournament doesn't just vanish.
func (*Cache) SetTournamentEventChan ¶
func (c *Cache) SetTournamentEventChan(ch chan<- *entity.EventWrapper)
SetTournamentEventChan sets the tournament event channel to the passed in channel.
func (*Cache) TournamentEventChan ¶
func (c *Cache) TournamentEventChan() chan<- *entity.EventWrapper
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
DBStore is a postgres-backed store for games.
func NewDBStore ¶
NewDBStore creates a new DB store for tournament managers.
func (*DBStore) ActiveTournamentsFor ¶
ActiveTournamentsFor returns a list of 2-tuples of tournament ID, division ID that this user is registered in - only for active tournaments (ones that have not finished).
func (*DBStore) AddRegistrants ¶
func (*DBStore) Disconnect ¶
func (s *DBStore) Disconnect()
func (*DBStore) GetRecentClubSessions ¶
func (*DBStore) GetRecentGames ¶
func (*DBStore) RemoveRegistrants ¶
func (*DBStore) RemoveRegistrantsForTournament ¶
func (*DBStore) SetTournamentEventChan ¶
func (s *DBStore) SetTournamentEventChan(c chan<- *entity.EventWrapper)
SetTournamentEventChan sets the tournament event channel to the passed in channel.
func (*DBStore) TournamentEventChan ¶
func (s *DBStore) TournamentEventChan() chan<- *entity.EventWrapper