response

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ok                  = 200
	NotOk               = 405
	Unauthorized        = 401
	Forbidden           = 403
	InternalServerError = 500
)

自定义错误码

View Source
const (
	OkMsg                      = "操作成功"
	NotOkMsg                   = "操作失败"
	UnauthorizedMsg            = "登录过期"
	LoginCheckErrorMsg         = "用户名或密码错误"
	ForbiddenMsg               = "无权访问该资源"
	InternalServerErrorMsg     = "服务器内部错误"
	IdempotenceTokenEmptyMsg   = "幂等性token为空"
	IdempotenceTokenInvalidMsg = "幂等性token失效"
)

自定义错误信息

Variables

自定义错误映射

Functions

This section is empty.

Types

type Response

type Response struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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