Documentation
¶
Overview ¶
Errors package implements the JSON API v1.0 format for errors. Ref: http://jsonapi.org/format/#errors
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetErrorClass ¶
GetErrorClass returns 400 or 500 depending of the error code passed. If the error code is less than 400 or greater or equal to 600 it returns 0.
Types ¶
type Bag ¶
func NewBagWithError ¶
NewBagWithError is a shorthand to `errors.NewBag().Add(status, detail)`
type Error ¶
type Error struct {
Code int `json:"code,string,omitempty"`
Debug map[string]interface{} `json:"debug,omitempty"`
Detail string `json:"detail"`
ID string `json:"id,omitempty"`
Links *Link `json:"links,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
Source *Source `json:"source,omitempty"`
Status int `json:"status,string"`
Title string `json:"title,omitempty"`
}
Error provides additional information about problems encountered while performing an operation.
func (*Error) AddSourceNode ¶
func (*Error) SetAboutLink ¶
func (*Error) SetParameter ¶
func (*Error) SetPointer ¶
Click to show internal directories.
Click to hide internal directories.