controllers

package
v0.0.0-...-22272ad Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AboutController

type AboutController struct {
	Controller
}

AboutController is the controller for the about page.

func NewAboutController

func NewAboutController(s *myradio.Session, c *structs.Config) *AboutController

NewAboutController returns a new AboutController with the MyRadio session s and configuration context c.

func (*AboutController) Get

func (aboutC *AboutController) Get(w http.ResponseWriter, r *http.Request)

Get handles the HTTP GET request r for the about us page, writing to w.

type CollegeSorter

type CollegeSorter []myradio.College

CollegeSorter exists so I can sort colleges properly

func (CollegeSorter) Len

func (s CollegeSorter) Len() int

Implement sort.Interface

func (CollegeSorter) Less

func (s CollegeSorter) Less(i, j int) bool

func (CollegeSorter) Swap

func (s CollegeSorter) Swap(i, j int)

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the base type of controllers in the 2016site architecture.

func (*Controller) Delete

func (c *Controller) Delete(w http.ResponseWriter, r *http.Request)

Delete handles a HTTP DELETE request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Get

func (c *Controller) Get(w http.ResponseWriter, r *http.Request)

Get handles a HTTP GET request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Head

func (c *Controller) Head(w http.ResponseWriter, r *http.Request)

Head handles a HTTP HEAD request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Options

func (c *Controller) Options(w http.ResponseWriter, r *http.Request)

Options handles a HTTP OPTIONS request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Patch

func (c *Controller) Patch(w http.ResponseWriter, r *http.Request)

Patch handles a HTTP PATCH request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Post

func (c *Controller) Post(w http.ResponseWriter, r *http.Request)

Post handles a HTTP POST request r, writing to w.

Unless overridden, controllers refuse this method.

func (*Controller) Put

func (c *Controller) Put(w http.ResponseWriter, r *http.Request)

Put handles a HTTP PUT request r, writing to w.

Unless overridden, controllers refuse this method.

type ControllerInterface

type ControllerInterface interface {
	Get()     //method = GET processing
	Post()    //method = POST processing
	Delete()  //method = DELETE processing
	Put()     //method = PUT handling
	Head()    //method = HEAD processing
	Patch()   //method = PATCH treatment
	Options() //method = OPTIONS processing
}

ControllerInterface is the interface to which controllers adhere.

type GetInvolvedController

type GetInvolvedController struct {
	Controller
}

GetInvolvedController is the controller for the get involved page.

func NewGetInvolvedController

func NewGetInvolvedController(s *myradio.Session, c *structs.Config) *GetInvolvedController

NewGetInvolvedController returns a new GetInvolvedController with the MyRadio session s and configuration context c.

func (*GetInvolvedController) Get

Get handles the HTTP GET request r for the get involved, writing to w.

type IndexController

type IndexController struct {
	Controller
}

IndexController is the controller for the index page.

func NewIndexController

func NewIndexController(s *myradio.Session, c *structs.Config) *IndexController

NewIndexController returns a new IndexController with the MyRadio session s and configuration context c.

func (*IndexController) Get

Get handles the HTTP GET request r for the index page, writing to w.

func (*IndexController) Post

Post handles the HTTP POST request r to the index page that sends a message. Writes to w.

type NotFoundController

type NotFoundController struct {
	Controller
	// contains filtered or unexported fields
}

NotFoundController is the controller for the 404 error page.

func NewNotFoundController

func NewNotFoundController(s *myradio.Session, c *structs.Config) *NotFoundController

NewNotFoundController returns a new NotFoundController with the MyRadio session s and configuration context c.

func (*NotFoundController) Get

Get handles the HTTP GET request r for the 404 page, writing to w. It first checks if a short URL matches, in which case it redirects to it.

type OnDemandController

type OnDemandController struct {
	Controller
}

OnDemandController is the controller for the URY On demand (URY on Tap) pages.

func NewOnDemandController

func NewOnDemandController(s *myradio.Session, c *structs.Config) *OnDemandController

NewOnDemandController returns a new OnDemandController with the MyRadio session s and configuration context c.

func (*OnDemandController) Get

func (onDemandC *OnDemandController) Get(w http.ResponseWriter, r *http.Request)

Get handles the HTTP GET request r for the page, writing to w.

type PeopleController

type PeopleController struct {
	Controller
}

PeopleController is the controller for the user bio page.

func NewPeopleController

func NewPeopleController(s *myradio.Session, c *structs.Config) *PeopleController

NewPeopleController returns a new PeopleController with the MyRadio session s and configuration context c.

func (*PeopleController) Get

Get handles the HTTP GET request r for the user bio page, writing to w.

type PodcastController

type PodcastController struct {
	Controller
}

PodcastController is the controller for the URYPlayer Podcast pages.

func NewPodcastController

func NewPodcastController(s *myradio.Session, c *structs.Config) *PodcastController

NewPodcastController returns a new PodcastController with the MyRadio session s and configuration context c.

func (*PodcastController) Get

func (podcastsC *PodcastController) Get(w http.ResponseWriter, r *http.Request)

Get handles the HTTP GET request r for a singular podcast page, writing to w.

func (*PodcastController) GetAllPodcasts

func (podcastsC *PodcastController) GetAllPodcasts(w http.ResponseWriter, r *http.Request)

GetAllPodcasts handles the HTTP GET request r for the all postcasts page, writing to w.

func (*PodcastController) GetEmbed

func (podcastsC *PodcastController) GetEmbed(w http.ResponseWriter, r *http.Request)

GetEmbed handles the HTTP GET request r for a singular podcast embed, writing to w.

type RenderData

type RenderData struct {
	CurrentAndNext *myradio.CurrentAndNext
	Banners        []myradio.Banner
	Timeslots      []myradio.Timeslot
	Podcasts       []myradio.Podcast
	MsgBoxError    bool
	ShowOnAir      bool
}

RenderData is used to pass parameters into a common render function

type ScheduleWeekController

type ScheduleWeekController struct {
	Controller
	// contains filtered or unexported fields
}

ScheduleWeekController is the controller for looking up week schedules.

func NewScheduleWeekController

func NewScheduleWeekController(s *myradio.Session, r *mux.Router, c *structs.Config) *ScheduleWeekController

NewScheduleWeekController returns a new ScheduleWeekController with the MyRadio session s, router r, and configuration context c. It assumes r already has routes installed for timeslots.

func (*ScheduleWeekController) GetByYearWeek

func (sc *ScheduleWeekController) GetByYearWeek(w http.ResponseWriter, r *http.Request)

GetByYearWeek handles the HTTP GET request r for week schedules by year/week date reference, writing to w.

It takes two request variables--year and week--, which correspond to an ISO 8601 year-week date.

func (*ScheduleWeekController) GetThisWeek

func (sc *ScheduleWeekController) GetThisWeek(w http.ResponseWriter, r *http.Request)

GetThisWeek handles the HTTP GET request r for this week's week schedule, writing to w.

It takes no request variables.

type SearchController

type SearchController struct {
	Controller
}

SearchController is the controller for the search page.

func NewSearchController

func NewSearchController(s *myradio.Session, c *structs.Config) *SearchController

NewSearchController returns a new SearchController with the MyRadio session s and configuration context c.

func (*SearchController) Get

Get handles the HTTP GET request r for the search page, writing to w.

type ShowController

type ShowController struct {
	Controller
}

ShowController is the controller for looking up shows.

func NewShowController

func NewShowController(s *myradio.Session, c *structs.Config) *ShowController

NewShowController returns a new ShowController with the MyRadio session s and configuration context c.

func (*ShowController) Get

Get handles the HTTP GET request r for all shows, writing to w.

func (*ShowController) GetPodcastRss

func (sc *ShowController) GetPodcastRss(w http.ResponseWriter, r *http.Request)

GetPodcastRSS handles the GET request for the show's associated podcast RSS feed.

func (*ShowController) GetPodcastRssHead

func (sc *ShowController) GetPodcastRssHead(w http.ResponseWriter, r *http.Request)

func (*ShowController) GetSeason

func (sc *ShowController) GetSeason(w http.ResponseWriter, r *http.Request)

GetSeason handles the HTTP GET request r for an individual season, writing to w.

func (*ShowController) GetShow

func (sc *ShowController) GetShow(w http.ResponseWriter, r *http.Request)

GetShow handles the HTTP GET request r for an individual show, writing to w.

func (*ShowController) GetTimeslot

func (sc *ShowController) GetTimeslot(w http.ResponseWriter, r *http.Request)

GetTimeslot handles the HTTP GET request r for an individual timeslot, writing to w.

func (*ShowController) GetUyco

func (sc *ShowController) GetUyco(w http.ResponseWriter, r *http.Request)

GetUyco handles the HTTP GET request r for the UYCO page, writing to w.

type SignUpController

type SignUpController struct {
	Controller
}

SignUpController is the controller for processing signup requests.

func NewSignUpController

func NewSignUpController(s *myradio.Session, c *structs.Config) *SignUpController

NewSignUpController returns a new SignUpController with the MyRadio session s and configuration context c.

func (*SignUpController) Post

func (gic *SignUpController) Post(w http.ResponseWriter, r *http.Request)

Post handles the HTTP POST request r for the get involved, writing to w.

type StaticController

type StaticController struct {
	Controller
}

StaticController is the controller for the static pages.

func NewStaticController

func NewStaticController(c *structs.Config) *StaticController

NewStaticController returns a new StaticController with the MyRadio session s and configuration context c.

func (*StaticController) GetCIN

func (staticC *StaticController) GetCIN(w http.ResponseWriter, r *http.Request)

func (*StaticController) GetCompetitions

func (staticC *StaticController) GetCompetitions(w http.ResponseWriter, r *http.Request)

GetCompetitions handles the HTTP GET request r for the Get Involved page, writing to w.

func (*StaticController) GetContact

func (staticC *StaticController) GetContact(w http.ResponseWriter, r *http.Request)

GetContact handles the HTTP GET request r for the Contact page, writing to w.

func (*StaticController) GetInvolved

func (staticC *StaticController) GetInvolved(w http.ResponseWriter, r *http.Request)

GetInvolved handles the HTTP GET request r for the Get Involved page, writing to w.

type TeamController

type TeamController struct {
	Controller
}

TeamController is the controller for the team information pages.

func NewTeamController

func NewTeamController(s *myradio.Session, c *structs.Config) *TeamController

NewTeamController returns a new TeamController with the MyRadio session s and configuration context c.

func (*TeamController) Get

func (teamC *TeamController) Get(w http.ResponseWriter, r *http.Request)

Get handles the HTTP GET request r for the user bio page, writing to w.

Jump to

Keyboard shortcuts

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