Documentation
¶
Index ¶
- type APIServer
- func (server *APIServer) GetSchedule(ctx context.Context, req *pg.GetScheduleRequest) (*pg.GetScheduleReply, error)
- func (server *APIServer) GetScores(ctx context.Context, req *pg.GetScoresRequest) (*pg.GetScoresReply, error)
- func (server *APIServer) GetScoresForPlayer(ctx context.Context, req *pg.GetScoresForPlayerRequest) (*pg.GetScoresForPlayerReply, error)
- func (server *APIServer) PlayerLogin(ctx context.Context, req *pg.PlayerLoginRequest) (*pg.PlayerLoginReply, error)
- func (server *APIServer) RegisterPlayer(ctx context.Context, req *pg.RegisterPlayerRequest) (*pg.RegisterPlayerReply, error)
- func (server *APIServer) RequestPlayerLogin(ctx context.Context, req *pg.RequestPlayerLoginRequest) (*pg.RequestPlayerLoginReply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct { DB *sql.DB Log *log.Entry // Include a default implementation of all RPC methods, even if we don't get around to defining it. pg.UnimplementedAPIServer }
APIServer is a struct for passing global context, such as the database handle.
func (*APIServer) GetSchedule ¶
func (server *APIServer) GetSchedule(ctx context.Context, req *pg.GetScheduleRequest) (*pg.GetScheduleReply, error)
GetSchedule returns a list of venues and transition times for an event.
func (*APIServer) GetScores ¶
func (server *APIServer) GetScores(ctx context.Context, req *pg.GetScoresRequest) (*pg.GetScoresReply, error)
GetScores returns an event's overall leaderboard.
func (*APIServer) GetScoresForPlayer ¶
func (server *APIServer) GetScoresForPlayer(ctx context.Context, req *pg.GetScoresForPlayerRequest) ( *pg.GetScoresForPlayerReply, error)
GetScoresForPlayer all scores for the requested player.
func (*APIServer) PlayerLogin ¶
func (server *APIServer) PlayerLogin(ctx context.Context, req *pg.PlayerLoginRequest) (*pg.PlayerLoginReply, error)
PlayerLogin accepts and validates an auth code, returning an auth token for use in authenticated API calls.
func (*APIServer) RegisterPlayer ¶
func (server *APIServer) RegisterPlayer(ctx context.Context, req *pg.RegisterPlayerRequest) (*pg.RegisterPlayerReply, error)
RegisterPlayer adds a new player to an event in an unconfirmed state and sends an auth code SMS to the provided phone number.
func (*APIServer) RequestPlayerLogin ¶
func (server *APIServer) RequestPlayerLogin(ctx context.Context, req *pg.RequestPlayerLoginRequest) ( *pg.RequestPlayerLoginReply, error)
RequestPlayerLogin sends an auth code via SMS to the user matching the provided event key and phone number, if one exists. A non-existent player will not trigger an error response, in order to prevent mining of user phone numbers.