utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MysqlError = ErrorCode{500002, "Mysql错误!"}
View Source
var NoAuth = ErrorCode{400101, "无权限!"}
View Source
var NotLogin = ErrorCode{40100, "未登录!"}
View Source
var ParamsError = ErrorCode{40000, "请求参数错误!"}
View Source
var RedisError = ErrorCode{500001, "Redis错误!"}
View Source
var ServerError = ErrorCode{500000, "服务器错误!"}

Functions

func GenSign

func GenSign(body, secretKey string) string

Types

type ErrorCode added in v0.3.0

type ErrorCode struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type Response added in v0.3.0

type Response struct {
	Message     string      `json:"message"`
	Code        int         `json:"code"`
	Data        interface{} `json:"data"`
	Description *string     `json:"description"`
}

func ResponseError added in v0.3.0

func ResponseError(errorCode ErrorCode, description ...string) *Response

func ResponseOK added in v0.3.0

func ResponseOK(data interface{}, description ...string) *Response

Jump to

Keyboard shortcuts

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