Documentation
¶
Index ¶
- type Basic
- type Error
- type Meta
- type Response
- func (r *Response) AddError(err Error) *Response
- func (r *Response) BadRequest()
- func (r *Response) BadRequestWithError(err error)
- func (r *Response) Empty()
- func (r *Response) ForbiddenWithError(err error)
- func (r *Response) NoContent()
- func (r *Response) NoContentWithError(err error)
- func (r *Response) NotFound()
- func (r *Response) Success()
- func (r *Response) Unauthorized()
- func (r *Response) UnexpectedError()
- func (r *Response) UnexpectedWithError(err error)
- func (r *Response) WithHeader(header int)
- type ResponseData
- type Status
- type TimeStartKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Basic ¶
type Basic struct { Message string `json:"message,omitempty"` Data ResponseData `json:"data,omitempty"` }
Basic represents a general response type, which can be empty, hold just a message, or a message and a list of message strings containing more information
type Response ¶
type Response struct { Writer http.ResponseWriter `json:"-"` Data interface{} `json:"data"` Error *Error `json:"error,omitempty"` Meta Meta `json:"meta"` }
func NewResponder ¶
func NewResponder(w http.ResponseWriter) Response
func (*Response) BadRequest ¶
func (r *Response) BadRequest()
func (*Response) BadRequestWithError ¶
func (*Response) ForbiddenWithError ¶
func (*Response) NoContentWithError ¶
func (*Response) Unauthorized ¶
func (r *Response) Unauthorized()
func (*Response) UnexpectedError ¶
func (r *Response) UnexpectedError()
func (*Response) UnexpectedWithError ¶
func (*Response) WithHeader ¶
type ResponseData ¶
type ResponseData map[string]interface{}
type TimeStartKey ¶
type TimeStartKey struct{}
Click to show internal directories.
Click to hide internal directories.