Back to godoc.org

Package errcode

v0.0.0-...-8edd1ee
Latest Go to latest

The latest major version is .

Published: Jun 13, 2020 | License: Apache-2.0 | Module: github.com/betterjun/starfire

Index

Variables

var InternalError = &apiErrorImp{1006, "内部错误"}
var InvalidParams = &apiErrorImp{1003, "参数无效"}

系统错误

var InvalidToken = &apiErrorImp{1001, "无效的登陆会话"}
var MysqlFailed = &apiErrorImp{1005, "sql数据库错误"}
var NoToken = &apiErrorImp{1000, "无令牌请求头"}

token相关

var RedisError = &apiErrorImp{1004, "nosql数据库错误"}
var Success = &apiErrorImp{0, "ok"}

正常

var TokenExpired = &apiErrorImp{1002, "登陆会话过期"}
var UserAlreadyRegistered = &apiErrorImp{1007, "用户已注册"}
var UserDisabled = &apiErrorImp{1010, "用户已禁用"}
var UserNotExists = &apiErrorImp{1008, "用户不存在"}
var UsernameOrPasswordError = &apiErrorImp{1009, "用户名或密码错误"}

func Resp

func Resp(ae APIError, data ...interface{}) gin.H

type APIError

type APIError interface {
	Code() int
	Message() string
	error
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier