ecode

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrKindUnmarshalConfigErr ...
	ErrKindUnmarshalConfigErr = "unmarshal config err"
	// ErrKindRegisterErr ...
	ErrKindRegisterErr = "register err"
	// ErrKindUriErr ...
	ErrKindUriErr = "uri err"
	// ErrKindRequestErr ...
	ErrKindRequestErr = "request err"
	// ErrKindFlagErr ...
	ErrKindFlagErr = "flag err"
	// ErrKindListenErr ...
	ErrKindListenErr = "listen err"
	// ErrKindAny ...
	ErrKindAny = "any"
)

统一 Err Kind

View Source
const (
	// MsgRegisterParseConfigErr1 ...
	MsgRegisterParseConfigErr1 = "register parse config err1"
	// MsgRegisterParseConfigErr2 ...
	MsgRegisterParseConfigErr2 = "register parse config err2"
	// MsgRegisterETCDErr ...
	MsgRegisterETCDErr = "register service err"
	// MsgRegisterETCDOk ...
	MsgRegisterETCDOk = "register service ok"
	// MsgDeleteParseProviderUriErr ...
	MsgDeleteParseProviderUriErr = "delete parse provider uri err"
	// MsgDeleteParseConfiguratorsUriErr ...
	MsgDeleteParseConfiguratorsUriErr = "delete parse configurators uri err"
	// MsgUpdateParseProviderUriErr ...
	MsgUpdateParseProviderUriErr = "update parse provider uri err"
	// MsgUpdateParseConfiguratorsUriErr ...
	MsgUpdateParseConfiguratorsUriErr = "update parse configurators uri err"
	// MsgUpdateParseConfigErr ...
	MsgUpdateParseConfigErr = "update parse config err"
	// MsgUpdateResolverOk ...
	MsgUpdateResolverOk = "update resolver ok"
	// MsgWatchRequestErr ...
	MsgWatchRequestErr = "watch request err"
	// MsgDeregisterETCDOk ...
	MsgDeregisterETCDOk = "deregister etcd service ok"
	// MsgDeregisterETCDErr ...
	MsgDeregisterETCDErr = "deregister etcd service err"
	// MsgRegistryResolverOk ...
	MsgRegistryResolverOk = "resolver build ok"
	// MsgRegistryResolverNow ...
	MsgRegistryResolverNow = "resolver now"
	// MsgRegistryResolverClose ...
	MsgRegistryResolverClose = "resolver close"

	// config msg
	MsgConfigParseFlagPanic = "parse flag panic"
	// MsgConfigLoadFromRemoteDataSourcePanic ...
	MsgConfigLoadFromRemoteDataSourcePanic = "load from remote datasource panic"
	// MsgConfigLoadFromRemoteDataSourceOK ...
	MsgConfigLoadFromRemoteDataSourceOK = "load from remote datasource ok"
	// MsgConfigLoadFromFilePanic ...
	MsgConfigLoadFromFilePanic = "load from file panic"
	// MsgConfigLoadFromFileOK ...
	MsgConfigLoadFromFileOK = "load from file ok"

	// app msg
	MsgAppStartServerOk = "server start"
	// MsgAppStartGovernorOk ...
	MsgAppStartGovernorOk = "governor start"

	// proc msg
	MsgProcSetPanic = "set max procs panic"
	// MsgProcSetOk ...
	MsgProcSetOk = "set max procs ok"

	// grpc server
	MsgGrpcServerNewErr = "new grpc server err"
	// MsgGrpcServerRecover ...
	MsgGrpcServerRecover = "grpc server recover"

	// client mysql
	MsgClientMysqlOpenStart = "client mysql start"
	// MsgClientMysqlOpenPanic ...
	MsgClientMysqlOpenPanic = "mysql open panic"
	// MsgClientMysqlPingPanic ...
	MsgClientMysqlPingPanic = "mysql ping panic"
)

统一 Msg信息,模块内信息唯一

View Source
const (
	// ModConfig ...
	ModConfig = "config"
	// ModApp ...
	ModApp = "app"
	// ModProc ...
	ModProc = "proc"
	// ModGrpcServer ...
	ModGrpcServer = "server.grpc"
	// ModRegistryETCD ...
	ModRegistryETCD = "registry.etcd"
	// ModClientETCD ...
	ModClientETCD = "client.etcd"
	// ModClientGrpc ...
	ModClientGrpc = "client.grpc"
	// ModClientMySQL ...
	ModClientMySQL = "client.mysql"
	// ModXcronETCD ...
	ModXcronETCD = "xcron.etcd"
)

统一模块信息

View Source
const EcodeNum int32 = 9999

EcodeNum 低于10000均为系统错误码,业务错误码请使用10000以上

Variables

View Source
var (

	// OK ...
	OK = add(int(codes.OK), "OK")
)

Functions

func Add

func Add(code int, message string) *spbStatus

Add ...

func ExtractCodes

func ExtractCodes(e error) *spbStatus

ExtractCodes cause from error to ecode.

Types

type Status

type Status interface {
}

Status ...

Jump to

Keyboard shortcuts

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