Documentation ¶
Overview ¶
Package server runs the http server after initializing the database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AboutRequester ¶
type AboutRequester interface {
PreviousDeployment() (*request.Deployment, error)
}
AboutRequester gets the previous deployment info for the app.
type AdminTab ¶
type AdminTab struct { Name string Action string Data []interface{} // each template knows what data to expect }
AdminTab provides tabs with admin tasks.
type Config ¶
type Config struct { DisplayName string Port string NflAppKey string LogRequestURIs bool HtmlFS fs.FS JavascriptFS fs.FS StaticFS fs.FS }
Config contains fields which describe the server
func (Config) New ¶
func (cfg Config) New(log *log.Logger, ds ServerDatastore, httpClient request.HTTPClient) (*Server, error)
New validates and creates a new Server from the config
type EtlStats ¶
type EtlStats struct {
// contains filtered or unexported fields
}
EtlStats contains ScoreCategories that were stored at a specific time
type Page ¶
type Page struct { ApplicationName string Title string Tabs []Tab ShowTabs bool Sports []SportEntry TimesMessage TimesMessage PageLoadTime time.Time // contains filtered or unexported fields }
Page is a page that gets rendered by the main template
type Server ¶
type Server struct { Config // contains filtered or unexported fields }
Server contains data to serve pages for the user.
type ServerDatastore ¶
type ServerDatastore interface { GetYears(st db.SportType) ([]db.Year, error) // contains filtered or unexported methods }
ServerDatastore provides a way for the server to store and retrieve data.
type SportEntry ¶
SportEntry contains the url and name of a SportType
type StatsTab ¶
type StatsTab struct { ScoreCategory request.ScoreCategory ExportURL string }
StatsTab provides stats information
type TimesMessage ¶
TimesMessage contains times to insert between messages