types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type All

type All interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 | string | bool | []byte | time.Time
}

All 支持的所有类型

type All1

type All1 interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 | string | bool | time.Time
}

All1 支持的所有类型(不包含[]byte)

type IntUintFloat

type IntUintFloat interface {
	int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64
}

IntUintFloat 支持的所有整数和浮点数类型

type Resp

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

func FailResp

func FailResp(msg string) Resp

func SuccResp

func SuccResp(data interface{}) Resp

func (Resp) IsSucc

func (r Resp) IsSucc() bool

type RespCode

type RespCode int
const (
	SuccErrCode RespCode = 0 // 操作成功
	FailErrCode RespCode = 1 // 操作失败

	InternalErrCode RespCode = 1000 // 内部错误
	ParamErrCode    RespCode = 1001 // 参数错误
	AuthErrCode     RespCode = 1002 // 认证错误
	PermErrCode     RespCode = 1003 // 权限错误
	ExistErrCode    RespCode = 1004 // 已存在错误
	NotFoundErrCode RespCode = 1005 // 未找到错误
	LimitErrCode    RespCode = 1006 // 限制错误
	TimeoutErrCode  RespCode = 1007 // 超时错误
	OtherErrCode    RespCode = 1008 // 其他错误
)

Jump to

Keyboard shortcuts

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