server

package
v0.0.0-...-7d4cad4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SprintsServer

func SprintsServer(cfg core.ServerConfig)

Types

type CmdServer

type CmdServer struct {
	Sprints *Sprints
	// contains filtered or unexported fields
}

func SetupCmdServer

func SetupCmdServer(port uint, debug bool, sprints *Sprints) (*CmdServer, error)

func (*CmdServer) Run

func (c *CmdServer) Run()

func (*CmdServer) Stop

func (c *CmdServer) Stop()

type Sprints

type Sprints struct {
	// contains filtered or unexported fields
}

func SetupSprints

func SetupSprints(device device.InputDevice, visMux *VisMux, sprintsDb *SprintsDb, countDownTime uint) (s *Sprints)

func (*Sprints) AbortRace

func (s *Sprints) AbortRace(_ context.Context, abortMessage *pb.AbortMessage) (*pb.Empty, error)

func (*Sprints) ConfigureVis

func (s *Sprints) ConfigureVis(_ context.Context, visCfg *pb.VisConfiguration) (*pb.Empty, error)

func (*Sprints) GetCurrentTournament

func (s *Sprints) GetCurrentTournament(context.Context, *pb.Empty) (*pb.Tournament, error)

func (*Sprints) GetResults

func (s *Sprints) GetResults(resultSpec *pb.ResultSpec, stream pb.Sprints_GetResultsServer) error

func (*Sprints) GetTournamentNames

func (s *Sprints) GetTournamentNames(context.Context, *pb.Empty) (*pb.TournamentNames, error)

func (*Sprints) LoadTournament

func (s *Sprints) LoadTournament(ctx context.Context, tournamentSpec *pb.TournamentSpec) (*pb.Tournament, error)

func (*Sprints) NewRace

func (s *Sprints) NewRace(ctx context.Context, race *pb.Race) (*pb.Empty, error)

func (*Sprints) NewTournament

func (s *Sprints) NewTournament(ctx context.Context, tournament *pb.Tournament) (*pb.Tournament, error)

func (*Sprints) ShowResults

func (s *Sprints) ShowResults(_ context.Context, resultSpec *pb.ResultSpec) (*pb.Empty, error)

func (*Sprints) StartRace

func (s *Sprints) StartRace(_ context.Context, _ *pb.Empty) (*pb.Player, error)

type SprintsDb

type SprintsDb struct {
	// contains filtered or unexported fields
}

func SetupSprintsDb

func SetupSprintsDb(fileName string) (s *SprintsDb, err error)

func (*SprintsDb) Close

func (s *SprintsDb) Close() error

func (*SprintsDb) GetLastTournament

func (s *SprintsDb) GetLastTournament() (*pb.Tournament, error)

func (*SprintsDb) GetTournament

func (s *SprintsDb) GetTournament(name string) (*pb.Tournament, error)

func (*SprintsDb) SaveTournament

func (s *SprintsDb) SaveTournament(tournament *pb.Tournament) error

type VisMux

type VisMux struct {
	// contains filtered or unexported fields
}

func SetupVisMux

func SetupVisMux(outputs string) (*VisMux, error)

func (*VisMux) AbortRace

func (v *VisMux) AbortRace(abortMessage *pb.AbortMessage) error

func (*VisMux) CloseRacers

func (v *VisMux) CloseRacers() error

func (*VisMux) ConfigureVis

func (v *VisMux) ConfigureVis(visCfg *pb.VisConfiguration) error

func (*VisMux) FinishRace

func (v *VisMux) FinishRace(results *pb.Results) error

func (*VisMux) NewRace

func (v *VisMux) NewRace(race *pb.Race) error

func (*VisMux) NewTournament

func (v *VisMux) NewTournament(tournament *pb.Tournament) error

func (*VisMux) SendRaceUpdate

func (v *VisMux) SendRaceUpdate(playerNum uint32, distance uint32)

func (*VisMux) SetupRacers

func (v *VisMux) SetupRacers()

func (*VisMux) ShowResults

func (v *VisMux) ShowResults(results *pb.Results)

func (*VisMux) StartRace

func (v *VisMux) StartRace(starter *pb.Starter) error

type VisMuxInterface

type VisMuxInterface interface {
	NewTournament(*pb.Tournament)
	NewRace(*pb.Race)
	StartRace(*pb.Starter)
	AbortRace(*pb.AbortMessage)
	ConfigureVis(*pb.VisConfiguration)

	SetupRacers()
	SendRaceUpdate(uint32, uint32)
	CloseRacers()
	FinishRace(*pb.Results)
	ShowResults(*pb.Results)
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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