common

package
v0.0.0-...-0480101 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

errno.go

Index

Constants

View Source
const (
	SuccessCode             = 0
	ServiceErrCode          = 10001
	ParamErrCode            = 10002
	LoginErrCode            = 10003
	UserNotExistErrCode     = 10004
	UserAlreadyExistErrCode = 10005
	OutRangeErrCode         = 10006
)

Variables

View Source
var (
	Success             = NewErrNo(SuccessCode, "Success")
	ServiceErr          = NewErrNo(ServiceErrCode, "Service is unable to start successfully")
	ParamErr            = NewErrNo(ParamErrCode, "Wrong Parameter has been given")
	LoginErr            = NewErrNo(LoginErrCode, "Wrong username or password")
	UserNotExistErr     = NewErrNo(UserNotExistErrCode, "User does not exists")
	UserAlreadyExistErr = NewErrNo(UserAlreadyExistErrCode, "User already exists")
	OutRangeErr         = NewErrNo(OutRangeErrCode, "Parameter is out of range.")
)

Functions

func Seed

func Seed(x string, y string, z string) string

func Show

func Show(c echo.Context) error

Types

type ErrNo

type ErrNo struct {
	ErrCode int64
	ErrMsg  string
}

func ConvertErr

func ConvertErr(err error) ErrNo

ConvertErr convert error to Errno

func NewErrNo

func NewErrNo(code int64, msg string) ErrNo

func (ErrNo) Error

func (e ErrNo) Error() string

func (ErrNo) WithMessage

func (e ErrNo) WithMessage(msg string) ErrNo

type Gua

type Gua struct {
	Id    int    `yaml:"id"`
	Name  string `yaml:"name"`
	Mx    int    `yaml:"mx"`
	Alias string `yaml:"alias"`
}

func GetGuaById

func GetGuaById(mx int) (Gua, error)

type GuaYaml

type GuaYaml struct {
	Guas []Gua `yaml:"gua"`
}

Jump to

Keyboard shortcuts

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