Documentation ¶
Index ¶
- type Dashboard
- type Help
- type Home
- type Mobile
- type Playlist
- type PlaylistInfo
- type PotentialSource
- type TemplateService
- func (t *TemplateService) TmplDashboard(w http.ResponseWriter, data Dashboard)
- func (t *TemplateService) TmplHelp(w http.ResponseWriter)
- func (t *TemplateService) TmplHome(w http.ResponseWriter, data Home)
- func (t *TemplateService) TmplMobile(w http.ResponseWriter)
- func (t *TemplateService) TmplPlaylist(w http.ResponseWriter, data Playlist)
- func (t *TemplateService) TmplTrackSource(w http.ResponseWriter, data TrackSource)
- type Templater
- type TrackSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dashboard ¶
type Dashboard struct { Playlists []PlaylistInfo Env string }
Dashboard is the data required to template `/dashboard`
type Playlist ¶
type Playlist struct { IsNew bool Name string NameErr string Description string DescriptionErr string Schedule store.Schedule Public bool Sources []TrackSource SourcesErr string PotentialSources []PotentialSource Env string }
Playlist is the data required to template '/playlist/{playlistID}'
type PlaylistInfo ¶
type PlaylistInfo struct { store.Playlist TotalSongs int BuildTagSrc string ScheduleBlurb string ScheduleSentence string ImageURL string FailureBlurb string }
PlaylistInfo is a playlist wrapped with extra metadata
type PotentialSource ¶
type PotentialSource struct { Name string ID string Type store.TrackSourceType ImageURL string }
PotentialSource is the data for a playlists potential source of tracks
type TemplateService ¶
type TemplateService struct {
// contains filtered or unexported fields
}
TemplateService is the concrete implmentation of Templater backed by html/template
func New ¶
func New(log *zap.SugaredLogger, env string) (*TemplateService, error)
New returns a pointer to a TemplateService
func (*TemplateService) TmplDashboard ¶
func (t *TemplateService) TmplDashboard(w http.ResponseWriter, data Dashboard)
TmplDashboard templates '/'
func (*TemplateService) TmplHelp ¶
func (t *TemplateService) TmplHelp(w http.ResponseWriter)
TmplHelp templates `/help`
func (*TemplateService) TmplHome ¶
func (t *TemplateService) TmplHome(w http.ResponseWriter, data Home)
TmplHome templates '/'
func (*TemplateService) TmplMobile ¶
func (t *TemplateService) TmplMobile(w http.ResponseWriter)
TmplMobile templates `/mobile`
func (*TemplateService) TmplPlaylist ¶
func (t *TemplateService) TmplPlaylist(w http.ResponseWriter, data Playlist)
TmplPlaylist templates '/playlist/{playlistID}'
func (*TemplateService) TmplTrackSource ¶
func (t *TemplateService) TmplTrackSource(w http.ResponseWriter, data TrackSource)
TmplTrackSource templates '/playlist/{playlistID}/source/type/{type}/name/{name}/id/{id}'
type Templater ¶
type Templater interface { TmplHome(w http.ResponseWriter, data Home) TmplDashboard(w http.ResponseWriter, data Dashboard) TmplPlaylist(w http.ResponseWriter, data Playlist) TmplTrackSource(w http.ResponseWriter, data TrackSource) TmplMobile(w http.ResponseWriter) TmplHelp(w http.ResponseWriter) }
Templater provides methods for templating HTML web pages
type TrackSource ¶
type TrackSource struct { store.TrackSource CountString string CountErr string }
TrackSource is the data required to template '/playlist/{playlistID}/source/type/{type}/name/{name}/id/{id}'