errorkits

package
v0.0.0-...-986a728 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// ErrorCodeArgumentLack 缺少参数
	ErrorCodeArgumentLack = 100
	// ErrorCodeArgumentTypeInvalid 参数类型错误
	ErrorCodeArgumentTypeInvalid = 101
	// ErrorCodeInvalidSignature 签名错误
	ErrorCodeInvalidSignature = 102
	// ErrorCodeExpiredRequest 请求已过期
	ErrorCodeExpiredRequest = 103
	// ErrorCodeArgumentValueInvalid 非法参数值
	ErrorCodeArgumentValueInvalid = 104
)

Variables

View Source
var (
	ErrorMessageFile = "config/error_msg.yaml"
)

Functions

func Init

func Init() map[string]*ErrorMessage

func ReadConfig

func ReadConfig(exit bool) map[string]*ErrorMessage

Types

type ErrorMessage

type ErrorMessage struct {
	Code    int    `json:"code" yaml:"code"`
	Title   string `json:"title" yaml:"title"`
	Content string `json:"content" yaml:"content"`
	Message string `json:"message" yaml:"message"`
}

func Get

func Get(key string) *ErrorMessage

Jump to

Keyboard shortcuts

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