bcode

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success                   = LocalCode{/* contains filtered or unexported fields */}
	ServerInternalError       = LocalCode{/* contains filtered or unexported fields */}
	RequestParameterIncorrect = LocalCode{/* contains filtered or unexported fields */}
	RequestBodyIncorrect      = LocalCode{/* contains filtered or unexported fields */}
	RequestPathIncorrect      = LocalCode{/* contains filtered or unexported fields */}
	RequestHeaderIncorrect    = LocalCode{/* contains filtered or unexported fields */}
	RequestMethodIncorrect    = LocalCode{/* contains filtered or unexported fields */}
	RequestContentTypeError   = LocalCode{/* contains filtered or unexported fields */}
	RequestContentLengthError = LocalCode{/* contains filtered or unexported fields */}
	UnknownError              = LocalCode{/* contains filtered or unexported fields */}
	PageNotFound              = LocalCode{/* contains filtered or unexported fields */}
	StatusForbidden           = LocalCode{/* contains filtered or unexported fields */}
	AlreadyExists             = LocalCode{/* contains filtered or unexported fields */}
	NotExist                  = LocalCode{/* contains filtered or unexported fields */}
	Expired                   = LocalCode{/* contains filtered or unexported fields */}
	OperationFailed           = LocalCode{/* contains filtered or unexported fields */}
	OperationTimeout          = LocalCode{/* contains filtered or unexported fields */}
	OperationLimit            = LocalCode{/* contains filtered or unexported fields */}
	OperationNotSupport       = LocalCode{/* contains filtered or unexported fields */}
	OperationNotAllow         = LocalCode{/* contains filtered or unexported fields */}
	OperationNotImplement     = LocalCode{/* contains filtered or unexported fields */}
	OperationNotPermission    = LocalCode{/* contains filtered or unexported fields */}
	OperationNotAvailable     = LocalCode{/* contains filtered or unexported fields */}
	VerifyFailed              = LocalCode{/* contains filtered or unexported fields */}
	VerifyTimeout             = LocalCode{/* contains filtered or unexported fields */}
	VerifyLimit               = LocalCode{/* contains filtered or unexported fields */}
	VerifyNotSupport          = LocalCode{/* contains filtered or unexported fields */}
	VerifyNotAllow            = LocalCode{/* contains filtered or unexported fields */}
	Unauthenticated           = LocalCode{/* contains filtered or unexported fields */}
	Unauthorized              = LocalCode{/* contains filtered or unexported fields */}
	Forbidden                 = LocalCode{/* contains filtered or unexported fields */}
	NotFound                  = LocalCode{/* contains filtered or unexported fields */}
	Conflict                  = LocalCode{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type BCode

type BCode interface {
	// Code - 返回一个错误码的具体信息
	Code() int
	// Message - 返回错误码所对应的中文解释大致错误
	Message() string
	// Output - 返回一个英文规范错误说明
	Output() string
}

BCode

错误码接口

错误码接口, 用于返回错误码信息.

方法:

  • Code 错误码(int)
  • Message 错误信息(string)
  • Output 报错英文规范说明(string)

func BaseLocalCode

func BaseLocalCode(output string, code int, message string) BCode

BaseLocalCode

基础错误码

用于创建一个基础的错误码, 用于返回错误码信息.

参数

  • output 报错英文规范说明(string)
  • code 错误码(int)
  • message 错误信息(string)

返回

  • BCode 本地错误码

func GcodeToLocalCode

func GcodeToLocalCode(gcode gcode.Code) BCode

GcodeToLocalCode

Gcode转换为本地错误码

用于将gcode转换为本地错误码, 用于返回错误码信息. Gcode 为 gogf/gf/v2/errors/gcode 包中的错误码.

参数

  • gcode gcode错误码

返回

  • BCode 本地错误码

type LocalCode

type LocalCode struct {
	// contains filtered or unexported fields
}

LocalCode

本地错误码

本地错误码, 用于返回错误码信息.

属性:

  • output: string, 英文输出
  • code: int, 状态码
  • message: string, 中文描述

func (LocalCode) Code

func (lc LocalCode) Code() int

Code

错误码

错误码, 用于返回错误码信息.

func (LocalCode) Message

func (lc LocalCode) Message() string

Message

错误信息

错误信息, 用于返回错误信息.

func (LocalCode) Output

func (lc LocalCode) Output() string

Output

英文输出

英文输出, 用于返回英文输出.

Jump to

Keyboard shortcuts

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