Documentation ¶
Index ¶
- func EmbedFSHandler(staticFS fs.FS) http.Handler
- func NewRenderer() echo.Renderer
- func SingleFileHandler(staticFS fs.FS, path, filetype string) echo.HandlerFunc
- type JArchiveIndex
- type QPartyPlayer
- type QPartySecret
- type RoomConfig
- type RoomID
- type RoomMetadata
- type RoomState
- type Server
- func (server *Server) ListCategoriesByYear(ctx echo.Context) error
- func (server *Server) LoadJArchiveIndex(jarchive_json []byte) error
- func (server *Server) NewRandomBoard() func(ctx echo.Context) error
- func (server *Server) RegisterRoutes() *http.Handler
- func (server *Server) RouteIndexJSON(index_name string) func(echo.Context) error
- func (server *Server) RouteInitiateUpdates() func(echo.Context) error
- func (server *Server) RouteJoinRoom(jsonFS fs.FS) func(echo.Context) error
- func (server *Server) RoutePlayRoom() func(echo.Context) error
- func (server *Server) RouteRandomCategories() func(echo.Context) error
- func (server *Server) RouteRandomChallenges() func(echo.Context) error
- func (server *Server) RouteRandomEpisode() func(echo.Context) error
- func (server *Server) RouteStaticFiles(staticFS fs.FS)
- func (server *Server) Serve(port int) error
- func (server *Server) ServeTLS(crt_path, key_path string) error
- type TemplateRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRenderer ¶
func NewRenderer() echo.Renderer
func SingleFileHandler ¶
Types ¶
type JArchiveIndex ¶
type JArchiveIndex struct { Version []uint `json:"version,omitempty"` Seasons map[qparty.SeasonID]qparty.SeasonMetadata `json:"seasons"` Categories map[string]qparty.CategoryMetadata `json:"categories"` Episodes map[qparty.EpisodeID]qparty.EpisodeStats `json:"episodes"` }
func (JArchiveIndex) WriteSeasonIndexJSON ¶
func (all_seasons JArchiveIndex) WriteSeasonIndexJSON(json_path string) error
type QPartyPlayer ¶
type QPartyPlayer struct {
Name string `json:"name"`
}
type QPartySecret ¶
type QPartySecret struct { QPartyPlayer Token string }
type RoomConfig ¶
type RoomConfig struct {
Notes string `json:"notes,omitempty"`
}
type RoomMetadata ¶
type RoomMetadata struct {
Rooms map[RoomID]RoomConfig
}
Maintains independent state for each room being managed.
type RoomState ¶
type RoomState struct { Tokens map[QPartySecret]bool Stream *sse.Stream HostPlayer string // contains filtered or unexported fields }
func NewRoomState ¶
func NewRoomState(config RoomConfig) *RoomState
type Server ¶
type Server struct { *http.Server Rooms map[RoomID]*RoomState // contains filtered or unexported fields }
func (*Server) ListCategoriesByYear ¶
func (*Server) LoadJArchiveIndex ¶
func (*Server) NewRandomBoard ¶
func (*Server) RegisterRoutes ¶
func (*Server) RouteIndexJSON ¶
Handler for static JSON files representing parts of the index.
func (*Server) RouteInitiateUpdates ¶
Notifies clients of changes using SSE (server-sent events). This could also be done with websockets, and perhaps that will be necessary for STT later. Even with websocket handling, SSE is still better for audience members.
The client app (e.g. a SPA in Vue) can listen to these events and update its local path structure to match updates in game state (e.g. view categories, peer buzz-in, challenge selection, etc.) that were not initiated by a player.
func (*Server) RouteJoinRoom ¶
func (*Server) RoutePlayRoom ¶
func (*Server) RouteRandomCategories ¶
func (*Server) RouteRandomChallenges ¶
func (*Server) RouteRandomEpisode ¶
func (*Server) RouteStaticFiles ¶
type TemplateRenderer ¶
type TemplateRenderer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.