Documentation
¶
Overview ¶
Package site serves read-only views that combine several domains: shared layout data, the home page, the contact page and the team page.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AffiliationSource ¶
type AffiliationSource interface {
ListMinimal(ctx context.Context) ([]affiliation.Public, error)
}
type Contact ¶
type Contact struct {
DisplayEmail string `json:"displayEmail,omitempty"`
// TeamEmailMode is which email team pages show, for the settings page.
TeamEmailMode string `json:"teamEmailMode"`
People []ContactPerson `json:"people"`
}
Contact is the contact page.
type ContactPerson ¶
type ContactPerson struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Role string `json:"role"`
ImageURL string `json:"imageUrl,omitempty"`
}
ContactPerson is a club official listed on the contact page.
type CountSource ¶
type CountSource interface {
Count() int
}
type Deps ¶
type Deps struct {
News NewsSource
WhatsOn WhatsOnSource
Sponsors SponsorSource
Affiliations AffiliationSource
Teams TeamSource
Players SquadSource
Settings SettingSource
Users UserSource
Visitors CountSource
Files *upload.Files
Version string
}
Deps are the services site reads from.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers serves /site, /home, /contact and /teams/{id}.
func NewHandlers ¶
type Home ¶
type Home struct {
LatestNews *news.Article `json:"latestNews,omitempty"`
NextEvent *whatson.Event `json:"nextEvent,omitempty"`
Sponsors []sponsor.Public `json:"sponsors"`
Affiliations []affiliation.Public `json:"affiliations"`
}
Home is the home page. Panels whose data failed to load are omitted.
type Info ¶
type Info struct {
Year int `json:"year"`
VisitorCount int `json:"visitorCount"`
DisplayEmail string `json:"displayEmail,omitempty"`
Version string `json:"version"`
Teams []team.Public `json:"teams"`
}
Info is the data every page's layout needs.
type Manager ¶
type Manager struct {
Name string `json:"name"`
// Email is left out unless team pages show managers' own emails.
Email string `json:"email,omitempty"`
}
Manager is a team manager's public contact.
type NewsSource ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service builds the cross-domain page data.
func NewService ¶
type SettingSource ¶
type SponsorSource ¶
type SquadSource ¶
type TeamDetail ¶
type TeamDetail struct {
Team team.Public `json:"team"`
// ContactEmail is the address to contact the team at when managers'
// own emails aren't shown (setting.TeamEmailMode); "" otherwise.
ContactEmail string `json:"contactEmail,omitempty"`
Managers []Manager `json:"managers"`
Sponsors []sponsor.Public `json:"sponsors"`
Players []player.Member `json:"players"`
}
TeamDetail is the public team page.
type TeamSource ¶
type UserSource ¶
Click to show internal directories.
Click to hide internal directories.