extract

package
v0.1.31-0...-b1e5c7a Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: ISC Imports: 8 Imported by: 0

Documentation

Index

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

func NewContext(c appengine.Context, desc string, r *http.Request) Context

NewContext returns a new Context.

func (Context) Admin

func (c Context) Admin(userID int64) (*mdl.User, error)

Admin returns a admin mdl.User object with respect to the userId passed as param.

func (Context) Count

func (c Context) Count() int64

Count extracts the 'count' value from the given http.Request returns 20 if none is found.

func (Context) CountOrDefault

func (c Context) CountOrDefault(d int64) int64

CountOrDefault extracts the 'count' value from the given http.Request returns 20 if none is found.

func (Context) Match

func (c Context) Match(tournament *mdl.Tournament) (*mdl.Tmatch, error)

Match returns a match instance.

func (Context) Page

func (c Context) Page() int64

Page extracts the 'page' value from the given http.Request returns 1 if none is found.

func (Context) RequestID

func (c Context) RequestID() (int64, error)

RequestID returns a int64 requestId from the HTTP request.

func (Context) Team

func (c Context) Team() (*mdl.Team, error)

Team returns a team object from the request passed in the context.

func (Context) TeamId

func (c Context) TeamId() (int64, error)

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

func (c Context) TournamentId() (int64, error)

TournamentId returns the Id of the tournament that the request holds.

func (Context) User

func (c Context) User() (*mdl.User, error)

User returns a User object from the request passed in the context.

func (Context) UserId

func (c Context) UserId() (int64, error)

UserId returns a userId. It gets the 'userId' from the request and parses it to int64

Jump to

Keyboard shortcuts

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