server

package
v0.0.0-...-26761ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL