code

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 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