Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
AuthMiddleware enforces HTTP Basic Authentication on the provided handler.
Types ¶
type Client ¶
A Client provides methods for interacting with an API server.
type Context ¶
type Context struct { ResponseWriter http.ResponseWriter Request *http.Request PathParams httprouter.Params }
A Context contains the values relevant to an HTTP handler.
func (Context) Check ¶
Check conditionally writes an error. If err is non-nil, Check prefixes it with msg, writes it to the response body, and returns true. Otherwise it returns false.
func (Context) Decode ¶
Decode decodes the JSON of the request body into v. If decoding fails, Decode writes an error to the response body and returns false.
func (Context) DecodeParam ¶
DecodeParam decodes the specified path parameter into v, which must be a pointer value with one of the following methods:
UnmarshalText([]byte) error LoadString(string) error
If decoding fails, DecodeParam writes an error to the response body and returns false.