Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct { XMLName xml.Name `json:"-" xml:"envelope"` StatusCode int `json:"-" xml:"-"` Status Status `json:"status" xml:"status"` Data interface{} `json:"data,omitempty" xml:"data,omitempty"` }
Envelope identifies the structure used to define a normalized endpoint response
func NewEnvelope ¶
NewEnvelope instantiates a new response data envelope structure
func (Envelope) SetEndpoint ¶
SetEndpoint assign the endpoint identifier to all stored error codes
func (Envelope) SetService ¶
SetService assign the service identifier to all stored error codes
type Error ¶
type Error struct { Service int `json:"-" xml:"-"` Endpoint int `json:"-" xml:"-"` Param int `json:"-" xml:"-"` Error int `json:"-" xml:"-"` Code string `json:"code" xml:"code"` Message string `json:"message" xml:"message"` }
Error defines a structure that hold the application error information.
func (Error) SetEndpoint ¶
SetEndpoint assigns an endpoint code value to the error.
func (Error) SetMessage ¶
SetMessage assigns a message to the error.
func (Error) SetService ¶
SetService assigns a service code value to the error.
type ErrorList ¶ added in v1.6.3
type ErrorList []Error
ErrorList defines a type of data that holds a list of error structures.
func (ErrorList) MarshalXML ¶ added in v1.6.3
MarshalXML serialize the error list into a xml string
type Status ¶
type Status struct { Status bool `json:"status" xml:"status"` Errors ErrorList `json:"errors" xml:"errors"` }
Status defines a structure that holds the result status of the request.
func NewStatus ¶
func NewStatus() Status
NewStatus instantiates a new request result status structure.
func (Status) SetEndpoint ¶
SetEndpoint assign an endpoint code to all stored errors.
func (Status) SetService ¶
SetService assign a service code to all stored errors.