code

package
v0.0.0-...-455e706 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 参数绑定发生错误
	ErrBind = iota + 101001
	// 验证参数出现问题
	ErrValidation
	// 查询user数据时该不存在
	ErrUserNotFound
	// 用户名或者密码错误 修改密码时
	ErrUserNameOrPwd
)
View Source
const (
	ErrPolicyNotFound int = iota + 101101
	ErrSecretNotFound
)

iam-apiserver: policy errors.

View Source
const (
	// 200 成功
	ErrSuccess int = iota + 100001
	ErrPageNotFound
)

默认参数

View Source
const (
	// 无效的验证head头 401 用户没有访问权限
	ErrInvalidAuthHead int = iota + 100201
	// Basic验证Authorization信息发生错误
	ErrInvalidBasic
	// cache 验证Authorization信息发生错误
	ErrInvalidCache
	// jwt已经过期
	ErrExpired
	// // 服务拒绝访问(非权限)
	ErrPermissionDenied
)

客户端 code

View Source
const (
	// base64编码失败
	ErrBaseCode int = iota + 100301
)
View Source
const (
	ErrDatabase int = iota + 100101
)

数据库 code

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCode

type ErrCode struct {
	C    int
	HTTP int
	Ext  string
	Ref  string
}

实现 err 的接口

func (ErrCode) Code

func (ec ErrCode) Code() int

func (ErrCode) HTTPStatus

func (ec ErrCode) HTTPStatus() int

func (ErrCode) Reference

func (ec ErrCode) Reference() string

返回引用文档

func (ErrCode) String

func (ec ErrCode) String() string

Jump to

Keyboard shortcuts

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