server

package
v0.0.0-...-84d7b07 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameData

type GameData struct {
	Lobby               bool
	EnoughUsersToStart  bool
	SubmitQuestion      bool
	SubmitAnswers       bool
	Voting              bool
	VoteResult          bool
	GameResult          bool
	Users               []string
	MyName              string
	MyQuestion          string
	UsersToQuestion     []string
	MyQuestionsToAnswer []*engine.MyQuestionToAnswer
	HasAnswered         bool
	UsersToAnswer       []string
	MyQuestionToVoteOn  *engine.MyQuestionToVoteOn
	HasVoted            bool
	UsersToVote         []string
	VotingResults       *engine.VotingResults
	GameResults         *engine.GameResults
}

type RootData

type RootData struct {
	Started bool
	Users   []string
}

type Server

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

func NewServer

func NewServer(worker *engine.Worker, updatesChannel chan engine.GameStateUpdate, templatesFS embed.FS) *Server

func (*Server) GameUpdateBroadcaster

func (s *Server) GameUpdateBroadcaster()

func (*Server) RootHandler

func (s *Server) RootHandler(w http.ResponseWriter, r *http.Request)

func (*Server) WebSocketHandler

func (s *Server) WebSocketHandler(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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