Documentation ¶
Index ¶
- Constants
- type APIError
- type CacheConfig
- type ServiceResponse
- func NewErrorNotFound(errMsg string) ServiceResponse
- func NewErrorResponse(status int, errorCode, errMsg string) ServiceResponse
- func NewServiceResponse(status int, response interface{}) ServiceResponse
- func NewServiceResponseWithHeader(status int, response interface{}, header http.Header) ServiceResponse
Constants ¶
View Source
const ( ContentTypeHeader = "Content-Type" ContentTypeApplicationJSON = "application/json; charset=utf-8" ContentTypePlainText = "text/plain; charset=utf-8" ContentTypeJSON = "json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { HTTPStatus int `json:"-"` ErrorCode string `json:"error_code"` Message string `json:"message"` Details string `json:"details,omitempty"` }
func NewAPIErrorResponse ¶
type CacheConfig ¶ added in v0.14.2
type ServiceResponse ¶
type ServiceResponse interface { Status() int Header() http.Header ResponseBytes() ([]byte, error) ResponseFormat() string Contents() interface{} }
func NewErrorNotFound ¶
func NewErrorNotFound(errMsg string) ServiceResponse
func NewErrorResponse ¶
func NewErrorResponse(status int, errorCode, errMsg string) ServiceResponse
func NewServiceResponse ¶
func NewServiceResponse(status int, response interface{}) ServiceResponse
func NewServiceResponseWithHeader ¶
func NewServiceResponseWithHeader(status int, response interface{}, header http.Header) ServiceResponse
Click to show internal directories.
Click to hide internal directories.