Documentation
¶
Index ¶
- type Context
- func (c Context) Admin(userID int64) (*mdl.User, error)
- func (c Context) Count() int64
- func (c Context) CountOrDefault(d int64) int64
- func (c Context) Match(tournament *mdl.Tournament) (*mdl.Tmatch, error)
- func (c Context) Page() int64
- func (c Context) RequestID() (int64, error)
- func (c Context) Team() (*mdl.Team, error)
- func (c Context) TeamId() (int64, error)
- func (c Context) TeamRequest() (*mdl.TeamRequest, error)
- func (c Context) Tournament() (*mdl.Tournament, error)
- func (c Context) TournamentId() (int64, error)
- func (c Context) User() (*mdl.User, error)
- func (c Context) UserId() (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context type holds the information needed to read the request and log any errors.
func NewContext ¶
NewContext returns a new Context.
func (Context) Admin ¶
Admin returns a admin mdl.User object with respect to the userId passed as param.
func (Context) Count ¶
Count extracts the 'count' value from the given http.Request returns 20 if none is found.
func (Context) CountOrDefault ¶
CountOrDefault extracts the 'count' value from the given http.Request returns 20 if none is found.
func (Context) Page ¶
Page extracts the 'page' value from the given http.Request returns 1 if none is found.
func (Context) TeamId ¶
TeamId returns the team identifier. It gets the 'teamID' from the request and parses it to int64
func (Context) TeamRequest ¶
func (c Context) TeamRequest() (*mdl.TeamRequest, error)
TeamRequest returns a a request to join a team from an HTTP request
func (Context) Tournament ¶
func (c Context) Tournament() (*mdl.Tournament, error)
Tournament returns a tournament instance. It gets the 'tournamentId' from the request and queries the datastore to get the tournament.
func (Context) TournamentId ¶
TournamentId returns the Id of the tournament that the request holds.