auth

Paddy 2014-12-14 Parent:5bccbed6631b Child:bc77a315f823

102:267483f168b5 Go to Latest

auth/request.go

Require config.Init in Context, add comment. Add comment to config.Init explaining what it is, to make golint happy. Create an ErrConfigNotInitialized error to use when a Config object is used to create a Context before it is initialized. Check for Config initialization in NewContext and throw ErrConfigNotInitialized if the Config hasn't been initialized.

History
paddy@99 1 package auth
paddy@99 2
paddy@99 3 const (
paddy@99 4 requestErrAccessDenied = "access_denied"
paddy@99 5 requestErrInsufficient = "insufficient"
paddy@99 6 requestErrOverflow = "overflow"
paddy@99 7 requestErrInvalidValue = "invalid_value"
paddy@99 8 requestErrInvalidFormat = "invalid_format"
paddy@99 9 requestErrMissing = "missing"
paddy@99 10 requestErrNotFound = "not_found"
paddy@99 11 requestErrConflig = "conflict"
paddy@99 12 requestErrActOfGod = "act_of_god"
paddy@99 13 )
paddy@99 14
paddy@99 15 type requestError struct {
paddy@99 16 Slug string `json:"error,omitempty"`
paddy@99 17 Field string `json:"field,omitempty"`
paddy@99 18 Param string `json:"param,omitempty"`
paddy@99 19 Header string `json:"header,omitempty"`
paddy@99 20 }