vcode

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CodeOk      = NewCode(0, "ok", nil)
	CodeSuccess = NewCode(0, "success", nil)

	CodeErrUnknown                = NewCode(10000, "unknown error", nil)
	CodeErrParamInvalid           = NewCode(10101, "param invalid", nil)
	CodeErrRequestExpired         = NewCode(10102, "request expired", nil)
	CodeErrSignInvalid            = NewCode(10103, "sign invalid", nil)
	CodeErrRateLimit              = NewCode(10104, "exceed request", nil)
	CodeErrParamBind              = NewCode(10110, "param bind error", nil)
	CodeErrDataCopy               = NewCode(10111, "data copy error", nil)
	CodeErrJsonDecode             = NewCode(10112, "json decode error", nil)
	CodeErrMapDecode              = NewCode(10113, "map decode error", nil)
	CodeErrStructDecode           = NewCode(10114, "struct decode error", nil)
	CodeErrDbOperation            = NewCode(10120, "database operation error", nil)
	CodeErrDbRecordNotFound       = NewCode(10121, "database record not found", nil)
	CodeErrHttpRequest            = NewCode(10130, "http request error", nil)
	CodeErrHttpStatusNotOk        = NewCode(10131, "http status not 200", nil)
	CodeErrRedisOperation         = NewCode(10140, "redis operation error", nil)
	CodeErrRedisAcquireLockFailed = NewCode(10141, "redis acquire lock failed", nil)
	CodeErrCronStartFailed        = NewCode(10150, "cron start failed", nil)
	CodeErrCloseConn              = NewCode(10160, "close connection error", nil)
	CodeErrInvalidData            = NewCode(10161, "invalid data", nil)
	CodeErrProtoUnmarshal         = NewCode(10162, "proto unmarshal error", nil)
)

Functions

This section is empty.

Types

type Code

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

func NewCode

func NewCode(code int, message string, data any) *Code

func (*Code) Code

func (c *Code) Code() int

func (*Code) CodeStr

func (c *Code) CodeStr() string

func (*Code) Data

func (c *Code) Data() any

func (*Code) Message

func (c *Code) Message() string

func (*Code) SetData

func (c *Code) SetData(data any)

func (*Code) SetMessage

func (c *Code) SetMessage(message string)

Jump to

Keyboard shortcuts

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