result

package
v0.0.0-...-0cfe510 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHttpResult

func AuthHttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)

http auth error

func GlobalErrorHandler

func GlobalErrorHandler(err error) (int, interface{})

func HttpResult

func HttpResult(r *http.Request, w http.ResponseWriter, resp interface{}, err error)

http response

func ParamErrorResult

func ParamErrorResult(r *http.Request, w http.ResponseWriter, err error)

http param error

Types

type NullJson

type NullJson struct{}

type ResponseError

type ResponseError struct {
	Status uint32 `json:"status"`
	Code   string `json:"code"`
	Msg    string `json:"msg"`
}

func Error

func Error(status uint32, errCode string, errMsg string) *ResponseError

type ResponseSuccess

type ResponseSuccess struct {
	Status uint32      `json:"status"`
	Code   string      `json:"code"`
	Msg    string      `json:"msg"`
	Data   interface{} `json:"data"`
}

func Success

func Success(data interface{}) *ResponseSuccess

Jump to

Keyboard shortcuts

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