server

package
v0.0.0-...-015e340 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

type Renderer interface {
	Render(w http.ResponseWriter, r *http.Request, d TemplateData, p string) error
}

Renderer is the interface that will be used to interact with the part of the program that is responsible for rendering the web pages

type Server

type Server struct {
	Log      *logrus.Logger
	Session  *sessions.Session
	Client   APIClient
	Renderer Renderer
}

Server is the struct that holds all the dependencies needed to run the application

func (*Server) ServeHTTP

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

type TemplateData

type TemplateData struct {
	Game       *client.Game
	User       *client.User
	Games      []TemplateGame
	Statuses   []client.Status
	Franchises []*client.Franchise

	SelectedFranchiseID string
	Error               string
	Flash               string
}

TemplateData is the struct that holds all the data that can be passed to the template renderer to render

type TemplateGame

type TemplateGame struct {
	ID            string
	Name          string
	FranchiseID   string
	FranchiseName string

	Status   client.Status
	Progress *client.GameProgress
}

TemplateGame is the struct that holds all the game info that is passed to the template renderer to render

Jump to

Keyboard shortcuts

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