Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingID = errors.New("missing required id") ErrMissingField = errors.New("missing required field") ErrInvalidField = errors.New("invalid or unparsable field") ErrRestrictedField = errors.New("field restricted for request") ErrConflictingFields = errors.New("only one field can be set") ErrModelIDMismatch = errors.New("resource id does not match id of endpoint") ErrUnparsable = errors.New("could not parse request") ErrUnknownUserRole = errors.New("unknown user role") ErrWeakPassword = errors.New("password must be at least 8 characters") )
Functions ¶
func NotAllowed ¶
NotAllowed returns a JSON 405 response for the API.
Types ¶
type LoginReply ¶
type LoginRequest ¶
type ReauthenticateRequest ¶
type ReauthenticateRequest struct {
RefreshToken string `json:"refresh_token"`
}
type RegisterReply ¶
type RegisterRequest ¶
type RegisterRequest struct {
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
}
func (*RegisterRequest) Validate ¶
func (r *RegisterRequest) Validate() error
type Reply ¶
type Reply struct {
Success bool `json:"success"`
Error string `json:"error,omitempty" yaml:"error,omitempty"`
}
Reply contains standard fields that are embedded in most API responses
func ErrorResponse ¶
func ErrorResponse(err interface{}) Reply
Construct a new response for an error or simply return unsuccessful.
type StatusReply ¶
type StatusReply struct {
Status string `json:"status"`
Uptime string `json:"uptime,omitempty"`
Version string `json:"version,omitempty"`
}
StatusReply is returned on status requests and heartbeats
Click to show internal directories.
Click to hide internal directories.