handler

package
v0.0.0-...-8bc6207 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affiliation

type Affiliation struct {
	Id       uint64 `json:"id"`
	Name     string `json:"name"`
	Website  string `json:"website"`
	FileName string `json:"file_name"`
}

type Document

type Document struct {
	Id       uint64 `json:"id"`
	Name     string `json:"name"`
	FileName string `json:"file_name"`
}

type Image

type Image struct {
	Id       uint64 `json:"id"`
	FileName string `json:"file_name"`
	Caption  string `json:"caption"`
}

type News

type News struct {
	Id       uint64 `json:"id"`
	Title    string `json:"title"`
	FileName string `json:"file_name"`
	Content  string `json:"content"`
	Date     int64  `json:"date"`
}

type Player

type Player struct {
	Id          uint64 `json:"id"`
	Name        string `json:"name"`
	FileName    string `json:"file_name"`
	DateOfBirth int64  `json:"date_of_birth"`
	Captain     bool   `json:"captain"`
	Team        uint64 `json:"team"`
}

type Programme

type Programme struct {
	Id                uint64 `json:"id"`
	Name              string `json:"name"`
	FileName          string `json:"file_name"`
	DateOfProgramme   int64  `json:"date_of_programme"`
	ProgrammeSeasonId uint64 `json:"programme_season_id"`
}

type ProgrammeSeason

type ProgrammeSeason struct {
	Id     uint64 `json:"id"`
	Season string `json:"season"`
}

type Session

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

Session represents an open API session.

func NewSession

func NewSession(baseURL string) (*Session, error)

NewSession constructs a new Session with a given url.

func (*Session) AddAffiliation

func (s *Session) AddAffiliation(affiliation Affiliation, token string) (a Affiliation, err error)

func (*Session) AddDocument

func (s *Session) AddDocument(document Document, token string) (d Document, err error)

func (*Session) AddImage

func (s *Session) AddImage(image Image, token string) (i Image, err error)

func (*Session) AddNews

func (s *Session) AddNews(news News, token string) (n News, err error)

func (*Session) AddPlayer

func (s *Session) AddPlayer(player Player, token string) (p Player, err error)

func (*Session) AddProgramme

func (s *Session) AddProgramme(p1 Programme, token string) (p Programme, err error)

func (*Session) AddProgrammeSeason

func (s *Session) AddProgrammeSeason(programmeSeason ProgrammeSeason, token string) (p ProgrammeSeason, err error)

func (*Session) AddSponsor

func (s *Session) AddSponsor(sp1 Sponsor, token string) (sp Sponsor, err error)

func (*Session) AddTeam

func (s *Session) AddTeam(team Team, token string) (t Team, err error)

func (*Session) AddUser

func (s *Session) AddUser(user UserFull, token string) (u UserFull, err error)

func (*Session) AddWhatsOn

func (s *Session) AddWhatsOn(whatsOn WhatsOn, token string) (w WhatsOn, err error)

func (*Session) DeleteAffiliation

func (s *Session) DeleteAffiliation(id uint64, token string) (err error)

func (*Session) DeleteDocument

func (s *Session) DeleteDocument(id uint64, token string) (err error)

func (*Session) DeleteImage

func (s *Session) DeleteImage(id uint64, token string) (err error)

func (*Session) DeleteNews

func (s *Session) DeleteNews(id uint64, token string) (err error)

func (*Session) DeletePlayer

func (s *Session) DeletePlayer(id uint64, token string) (err error)

func (*Session) DeleteProgramme

func (s *Session) DeleteProgramme(id uint64, token string) (err error)

func (*Session) DeleteProgrammeSeason

func (s *Session) DeleteProgrammeSeason(id uint64, token string) (err error)

func (*Session) DeleteSponsor

func (s *Session) DeleteSponsor(id uint64, token string) (err error)

func (*Session) DeleteTeam

func (s *Session) DeleteTeam(id uint64, token string) (err error)

func (*Session) DeleteUserFromEmail

func (s *Session) DeleteUserFromEmail(email, token string) (err error)

func (*Session) DeleteUserFromId

func (s *Session) DeleteUserFromId(id uint64, token string) (err error)

func (*Session) DeleteWhatsOn

func (s *Session) DeleteWhatsOn(id uint64, token string) (err error)

func (*Session) EditDocument

func (s *Session) EditDocument(document Document, token string) (d Document, err error)

func (*Session) EditNews

func (s *Session) EditNews(news News, token string) (p News, err error)

func (*Session) EditPlayer

func (s *Session) EditPlayer(player Player, token string) (p Player, err error)

func (*Session) EditProgrammeSeason

func (s *Session) EditProgrammeSeason(programmeSeason ProgrammeSeason, token string) (p ProgrammeSeason, err error)

func (*Session) EditSponsor

func (s *Session) EditSponsor(sp1 Sponsor, token string) (sp Sponsor, err error)

func (*Session) EditTeam

func (s *Session) EditTeam(team Team, token string) (t Team, err error)

func (*Session) EditUser

func (s *Session) EditUser(user UserFull, token string) (u UserFull, err error)

func (*Session) EditWhatsOn

func (s *Session) EditWhatsOn(whatsOn WhatsOn, token string) (w WhatsOn, err error)

func (*Session) GetAffiliationById

func (s *Session) GetAffiliationById(id uint64) (a Affiliation, err error)

func (*Session) GetDocumentById

func (s *Session) GetDocumentById(id uint64) (d Document, err error)

func (*Session) GetImageById

func (s *Session) GetImageById(id uint64) (i Image, err error)

func (*Session) GetNewsById

func (s *Session) GetNewsById(id uint64) (n News, err error)

func (*Session) GetNewsLatest

func (s *Session) GetNewsLatest() (n News, err error)

func (*Session) GetPlayerById

func (s *Session) GetPlayerById(id uint64) (p Player, err error)

func (*Session) GetProgrammeById

func (s *Session) GetProgrammeById(id uint64) (p Programme, err error)

func (*Session) GetProgrammeSeasonById

func (s *Session) GetProgrammeSeasonById(id uint64) (p ProgrammeSeason, err error)

func (*Session) GetSponsorById

func (s *Session) GetSponsorById(id uint64) (sp Sponsor, err error)

func (*Session) GetTeamById

func (s *Session) GetTeamById(id uint64) (t Team, err error)

func (*Session) GetUserByEmail

func (s *Session) GetUserByEmail(email, token string) (u User, err error)

func (*Session) GetUserByEmailFull

func (s *Session) GetUserByEmailFull(email, token string) (u UserFull, err error)

func (*Session) GetUserById

func (s *Session) GetUserById(id uint64, token string) (u User, err error)

func (*Session) GetUserByIdFull

func (s *Session) GetUserByIdFull(id uint64, token string) (u UserFull, err error)

func (*Session) GetUserByToken

func (s *Session) GetUserByToken(token string) (u User, err error)

func (*Session) GetUserByTokenFull

func (s *Session) GetUserByTokenFull(token string) (u UserFull, err error)

func (*Session) GetWhatsOnById

func (s *Session) GetWhatsOnById(id uint64) (w WhatsOn, err error)

func (*Session) GetWhatsOnLatest

func (s *Session) GetWhatsOnLatest() (w WhatsOn, err error)

func (*Session) ListActiveTeams

func (s *Session) ListActiveTeams() (t []Team, err error)

func (*Session) ListAllAffiliations

func (s *Session) ListAllAffiliations() (a []Affiliation, err error)

func (*Session) ListAllDocuments

func (s *Session) ListAllDocuments() (d []Document, err error)

func (*Session) ListAllImages

func (s *Session) ListAllImages() (i []Image, err error)

func (*Session) ListAllNews

func (s *Session) ListAllNews() (n []News, err error)

func (*Session) ListAllPlayers

func (s *Session) ListAllPlayers(token string) (p []Player, err error)

func (*Session) ListAllPlayersByTeam

func (s *Session) ListAllPlayersByTeam(teamId uint64) (p []Player, err error)

func (*Session) ListAllProgrammeSeasons

func (s *Session) ListAllProgrammeSeasons() (p []ProgrammeSeason, err error)

func (*Session) ListAllProgrammes

func (s *Session) ListAllProgrammes() (p []Programme, err error)

func (*Session) ListAllSponsors

func (s *Session) ListAllSponsors() (sp []Sponsor, err error)

func (*Session) ListAllSponsorsByTeamId

func (s *Session) ListAllSponsorsByTeamId(teamId uint64) (sponsors []Sponsor, err error)

func (*Session) ListAllSponsorsMinimal

func (s *Session) ListAllSponsorsMinimal() (sp []Sponsor, err error)

func (*Session) ListAllTeams

func (s *Session) ListAllTeams(token string) (t []Team, err error)

func (*Session) ListAllUsers

func (s *Session) ListAllUsers(token string) (u []User, err error)

func (*Session) ListAllWhatsOn

func (s *Session) ListAllWhatsOn() (w []WhatsOn, err error)

func (*Session) ListAllWhatsOnEventFuture

func (s *Session) ListAllWhatsOnEventFuture() (w []WhatsOn, err error)

func (*Session) ListAllWhatsOnEventPast

func (s *Session) ListAllWhatsOnEventPast() (w []WhatsOn, err error)

func (*Session) ListContactUsers

func (s *Session) ListContactUsers() (u []User, err error)

func (*Session) ListTeamManagersUsers

func (s *Session) ListTeamManagersUsers(teamId uint64) (u []User, err error)
type Sponsor struct {
	Id       uint64 `json:"id"`
	Name     string `json:"name"`
	Website  string `json:"website"`
	FileName string `json:"file_name"`
	Purpose  string `json:"purpose"`
	Team     string `json:"team"`
}

type Team

type Team struct {
	Id          uint64 `json:"id"`
	Name        string `json:"name"`
	League      string `json:"league,omitempty"`
	Division    string `json:"division,omitempty"`
	LeagueTable string `json:"league_table,omitempty"`
	Fixtures    string `json:"fixtures,omitempty"`
	Coach       string `json:"coach,omitempty"`
	Physio      string `json:"physio,omitempty"`
	FileName    string `json:"file_name,omitempty"`
	Active      bool   `json:"active"`
	Youth       bool   `json:"youth"`
	Ages        int    `json:"ages"`
}

type User

type User struct {
	Id       uint64 `json:"id"`
	Email    string `json:"email"`
	Name     string `json:"name"`
	Phone    string `json:"phone,omitempty"`
	Team     string `json:"team,omitempty"`
	Role     string `json:"role"`
	FileName string `json:"file_name,omitempty"`
}

User represents a user object to be used when not all data is required

type UserFull

type UserFull struct {
	User
	Password  string `json:"password,omitempty"`
	Temp      string `json:"temp,omitempty"`
	Hash      []byte `json:"hash,omitempty"`
	Salt      []byte `json:"salt,omitempty"`
	LastLogin int64  `json:"last_login,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	CreatedBy User   `json:"created_by,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
	UpdatedBy User   `json:"updated_by,omitempty"`
	DeletedAt int64  `json:"deleted_at,omitempty"`
	DeletedBy User   `json:"deleted_by,omitempty"`
}

UserFull represents a user and all columns

type WhatsOn

type WhatsOn struct {
	Id          uint64 `json:"id"`
	Title       string `json:"title"`
	FileName    string `json:"file_name,omitempty"`
	Content     string `json:"content"`
	Date        int64  `json:"date"`
	DateOfEvent int64  `json:"date_of_event"`
	Delete      bool   `json:"delete,omitempty"`
}

Directories

Path Synopsis
Package api exposes a low-level interface to the MyRadio API.
Package api exposes a low-level interface to the MyRadio API.

Jump to

Keyboard shortcuts

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