code

package
v0.0.34 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nil              = NewCode(-1, "", nil)
	InternalError    = NewCode(1, "internal error", nil)
	InvalidParameter = NewCode(2, "invalid parameter", nil)
	NotLocatedUser   = NewCode(3, "not located user", nil)
)

Functions

This section is empty.

Types

type Code

type Code interface {
	// Code 返回错误码
	Code() int
	// Message 返回错误码消息
	Message() string
	// Detail 返回错误码详情
	Detail() interface{}
	// String 格式化错误码
	String() string
}

func NewCode

func NewCode(code int, message string, detail interface{}) Code

Jump to

Keyboard shortcuts

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