Help us shape the future of Go! Take the 2026 Go Developer Survey

errcode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success       = NewError(0, "Success")
	ServerError   = NewError(10000000, "Server Error")
	InvalidParams = NewError(10000001, "Invalid Params")
	NotFound      = NewError(10000002, "Not Found")

	ErrorUserLogin    = NewError(20010001, "User Login Failed")
	ErrorUserNotLogin = NewError(20010002, "User Login Required")
	ErrorUserRegister = NewError(20010003, "User Register Failed")
	ErrorUserGet      = NewError(20010004, "User Get Profile Failed")
	ErrorUserEdit     = NewError(20010005, "User Edit Profile Failed")

	ErrorUploadPicFailed = NewError(30010001, "Upload Picture Failed")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int      `json:"code"`
	Msg     string   `json:"msg"`
	Details []string `json:"detail"`
}

func NewError

func NewError(code int, msg string) *Error

func (*Error) GetCode

func (e *Error) GetCode() int

func (*Error) GetDetails

func (e *Error) GetDetails() []string

func (*Error) GetError

func (e *Error) GetError() string

func (*Error) GetMsg

func (e *Error) GetMsg() string

func (*Error) StatusCode

func (e *Error) StatusCode() int

Jump to

Keyboard shortcuts

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