Documentation ¶
Index ¶
Constants ¶
View Source
const UnknownTheCodeStrf = "the error code is '%d', unknown meaning"
UnknownTheCodeStrf const define unknow code
View Source
const UnknownTheLanguageStrf = "the language code is '%s', unknown meaning"
UnknownTheLanguageStrf define unknow language
Variables ¶
View Source
var EmptyErrorsSetting = map[string]ErrorCode{}
EmptyErrorsSetting empty errors setting
Functions ¶
Types ¶
type CCErrorCoder ¶
CCErrorCoder get Error Code
type CCErrorIf ¶
type CCErrorIf interface { // CreateDefaultCCErrorIf create new language error interface instance CreateDefaultCCErrorIf(language string) DefaultCCErrorIf // Error returns an error for specific language Error(language string, errCode int) error // Errorf Errorf returns an error with args for specific language Errorf(language string, errCode int, args ...interface{}) error Load(res map[string]ErrorCode) }
CCErrorIf defines error information conversion
func NewFromCtx ¶
type DefaultCCErrorIf ¶
type DefaultCCErrorIf interface { // Error returns an error with error code Error(errCode int) error // Errorf returns an error with error code Errorf(errCode int, args ...interface{}) error // New create a new error with error code and message New(errorCode int, msg string) error }
DefaultCCErrorIf defines default error code interface
Click to show internal directories.
Click to hide internal directories.