Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Params httprouter.Params BeatmapService cheesegull.BeatmapService FileResolver cheesegull.FileResolver Communication cheesegull.CommunicationService Logging cheesegull.Logging ErrorHandler func(error) Request *http.Request }
Context is the information about the request passed to an handler in the http package, alongside http.ResponseWriter and *http.Request.
func (*Context) HandleError ¶
HandleError handles an error, passing it to ErrorHandler or printing it and printing the stacktrace.
func (*Context) QueryDefault ¶ added in v1.0.0
QueryDefault returns a value from the query string. If it's not set, the default value provided is used.
func (*Context) QueryInt ¶ added in v1.0.0
QueryInt gets an integer value from the querystring. Returns 0 if it's not a valid int.
func (*Context) QueryIntDefault ¶ added in v1.0.0
QueryIntDefault gets an integer value from the querystring, or if the requested parameter is not in the querystring, then it returns a default value.
func (*Context) QueryIntMultiple ¶ added in v1.0.0
QueryIntMultiple is basically like QueryInt, but returns an []int with all the ints with the same key passed.