Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EMPTY_JSON_STRING = []byte("") EMPTY_JSON_OBJECT = []byte("{}") )
View Source
var (
StatusOK = NewHttpStatus(http.StatusOK, nil)
)
Functions ¶
func WrapHttpStatusError ¶
Types ¶
type HttpStatus ¶
type HttpStatus struct {
// contains filtered or unexported fields
}
func HttpStatusFromError ¶
func HttpStatusFromError(err error) (hs *HttpStatus, ok bool)
func NewErrorHttpStatus ¶
func NewErrorHttpStatus(code int, msg string) *HttpStatus
func NewHttpStatus ¶
func NewHttpStatus(code int, content map[string]interface{}) *HttpStatus
func WrapErrorHttpStatus ¶
func WrapErrorHttpStatus(code int, err error) *HttpStatus
func (*HttpStatus) Code ¶
func (hs *HttpStatus) Code() int
func (*HttpStatus) Content ¶
func (hs *HttpStatus) Content() map[string]interface{}
func (*HttpStatus) Err ¶
func (hs *HttpStatus) Err() error
func (*HttpStatus) Message ¶
func (hs *HttpStatus) Message() []byte
Click to show internal directories.
Click to hide internal directories.