http_status

package
v1.3.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 3 Imported by: 0

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

func WrapHttpStatusError(code int, err error) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL