def

package
v1.3.99 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 2 Imported by: 13

Documentation

Index

Constants

View Source
const (
	LiteMode = "1"
	ViewMode = "2"
)
View Source
const (
	// Succeeded 成功
	Succeeded = iota
	// Warned 警告
	Warned = 200000
	// NoExist 对象不存在
	NoExist = 200001
	// Failed 失败
	Failed = 500000
	// IllegalParam 非法参数
	IllegalParam = 500001
	// InvalidAuthority 非法授权
	InvalidAuthority = 500002
	// Redirect 对象转移
	Redirect = 500003
	// UnExpected 意外错误
	UnExpected = 500004
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonResult added in v1.3.29

type CommonResult struct {
	Result
	Value json.RawMessage `json:"value"`
}

type CommonSliceResult added in v1.3.29

type CommonSliceResult struct {
	Result
	Total int64           `json:"total"`
	Value json.RawMessage `json:"values"`
}

type ErrorCode

type ErrorCode int

type Result

type Result struct {
	ErrorCode ErrorCode `json:"errorCode"`
	Reason    string    `json:"reason"`
}

Result 处理结果 ErrorCode 错误码 Reason 错误信息

func NewError added in v1.3.36

func NewError(errCode ErrorCode, reason string) *Result

func NewWarn added in v1.3.34

func NewWarn(errCode ErrorCode, reason string) *Result

func (*Result) Error

func (s *Result) Error() string

func (*Result) Fail

func (s *Result) Fail() bool

Fail 失败

func (*Result) Success

func (s *Result) Success() bool

Success 成功

func (*Result) Warn added in v1.3.34

func (s *Result) Warn() bool

Jump to

Keyboard shortcuts

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