Documentation ¶
Index ¶
- type BaseError
- type Builder
- type GenericResponse
- func NewError(msg errors.CodeMsg) GenericResponse
- func NewErrorWithData(msg errors.CodeMsg, data interface{}) GenericResponse
- func NewErrorWithDetails(msg errors.CodeMsg, details []InnerError) GenericResponse
- func NewSuccess() GenericResponse
- func NewSuccessWithData(data interface{}) GenericResponse
- type InnerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseError ¶
type BaseError struct { Code int `json:"code"` // One of a server-defined set of error codes. Message string `json:"message"` // A human-readable representation of the error. ErrorMessage string `json:"errorMessage"` Details []InnerError `json:"details"` // Optional, An array of Details about specific errors that led to this reported error. }
BaseError base error wich will be shown to the client
type Builder ¶
type Builder struct {
GenericResponse
}
func NewResponseBuilder ¶
func NewResponseBuilder() *Builder
func (*Builder) Build ¶
func (rb *Builder) Build() GenericResponse
func (*Builder) BuildPointer ¶
func (rb *Builder) BuildPointer() *GenericResponse
type GenericResponse ¶
type GenericResponse struct { Success bool `json:"success"` // Success - true, false Data interface{} `json:"data"` // Optional Error *BaseError `json:"error,omitempty"` // Optional Next string `json:"next,omitempty"` // Next Paginated Url Prev string `json:"prev,omitempty"` // Prev Paginated Url }
GenericResponse is an extension of the BaseResponse which contains additional requestUUID tag
func NewError ¶
func NewError(msg errors.CodeMsg) GenericResponse
func NewErrorWithData ¶
func NewErrorWithData(msg errors.CodeMsg, data interface{}) GenericResponse
func NewErrorWithDetails ¶
func NewErrorWithDetails(msg errors.CodeMsg, details []InnerError) GenericResponse
func NewSuccess ¶
func NewSuccess() GenericResponse
func NewSuccessWithData ¶
func NewSuccessWithData(data interface{}) GenericResponse
func (*GenericResponse) UnmarshalData ¶
func (gen *GenericResponse) UnmarshalData(data interface{})
Click to show internal directories.
Click to hide internal directories.