ires

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MulanPSL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK                  = http.StatusOK
	StatusBadRequest          = http.StatusBadRequest
	StatusNotFound            = http.StatusNotFound
	StatusInternalServerError = http.StatusInternalServerError
	StatusServiceUnavailable  = http.StatusServiceUnavailable
)

Variables

This section is empty.

Functions

func StatusText

func StatusText(code int) string

func ToByte

func ToByte(res IRes) ([]byte, error)

Types

type IRes

type IRes struct {
	//返回状态码200成功
	Code int `json:"code"`
	//返回描述信息
	Msg string `json:"msg"`
	//返回内容体
	Data interface{} `json:"data,omitempty"`
}

IRes 返回结构体

func GetDataRes

func GetDataRes(code int, msg string, data interface{}) IRes

func GetErrRes

func GetErrRes(code int, err error) IRes

func GetMsgRes

func GetMsgRes(code int, msg string) IRes

Jump to

Keyboard shortcuts

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