models

package
v0.0.0-...-1cae76b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexModel

type IndexModel struct {
	Model
}

IndexModel is the model for the Index controller.

func NewIndexModel

func NewIndexModel(s *myradio.Session) *IndexModel

NewIndexModel returns a new IndexModel on the MyRadio session s.

func (*IndexModel) Get

func (m *IndexModel) Get() ([]myradio.Timeslot, error)

Get gets the data required for the Index controller from MyRadio.

Otherwise, it returns undefined data and the error causing failure.

type Model

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

Model is the base type of models in the 2016site architecture.

Each model wraps the MyRadio API to provide the data required for a controller.

type ModelInterface

type ModelInterface interface {
	Get() (data *interface{}, err error) // @TODO: Refactor this to a more appropriate name
}

ModelInterface is the interface to which models adhere.

type ShowModel

type ShowModel struct {
	Model
}

ShowModel is the model for the Show controller.

func NewShowModel

func NewShowModel(s *myradio.Session) *ShowModel

NewShowModel returns a new ShowModel on the MyRadio session s.

func (*ShowModel) Get

func (m *ShowModel) Get(id int) (show myradio.ShowMeta, timeslots []myradio.Timeslot, err error)

Get gets the data required for the Show controller from MyRadio.

Otherwise, it returns undefined data and the error causing failure.

type UserModel

type UserModel struct {
	Model
}

UserModel is the model for the User controller.

func NewUserModel

func NewUserModel(s *myradio.Session) *UserModel

NewUserModel returns a new UserModel on the MyRadio session s.

func (*UserModel) Get

func (m *UserModel) Get(id int) (user myradio.User, timeslots []myradio.Timeslot, err error)

Get gets the data required for the User controller from MyRadio.

Otherwise, it returns undefined data and the error causing failure.

Jump to

Keyboard shortcuts

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