 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCode ¶
type ErrorCode interface {
	SimpleError
	Code() uint64
	StackTrace() string
	Context() ErrorContext
	Append(err ...error) ErrorCode
	WithContext(k string, v interface{}) ErrorCode
}
    ErrorCode Error functions
func NewErrorCode ¶
func NewErrorCode(ofs ...OptionFunc) ErrorCode
NewErrorCode get a new error code
type ErrorCodeTmpl ¶
type ErrorCodeTmpl struct {
	// contains filtered or unexported fields
}
    ErrorCodeTmpl error code template
func TN ¶
func TN(namespace string, code uint64, message string) *ErrorCodeTmpl
TN returns a new error code template
func (*ErrorCodeTmpl) New ¶
func (p *ErrorCodeTmpl) New(v ...Params) ErrorCode
New ErrorCodeTmpl new error code by template
type ErrorContext ¶
type ErrorContext map[string]interface{}
ErrorContext map contexts
func (ErrorContext) Error ¶ added in v1.7.0
func (p ErrorContext) Error() string
type ErrorOptions ¶ added in v1.7.0
type ErrorOptions struct {
	// contains filtered or unexported fields
}
    ErrorOptions error parmas
func (*ErrorOptions) NewSimpleError ¶ added in v1.7.0
func (p *ErrorOptions) NewSimpleError() SimpleError
NewSimpleError new simple errors by options
type OptionFunc ¶ added in v1.7.0
type OptionFunc func(*ErrorOptions)
OptionFunc set params
func OptionCode ¶ added in v1.7.0
func OptionCode(code uint64) OptionFunc
OptionCode set error code into options
func OptionContext ¶ added in v1.7.0
func OptionContext(ctx map[string]interface{}) OptionFunc
OptionContext set error code into options
func OptionMesssage ¶ added in v1.7.0
func OptionMesssage(msg string) OptionFunc
OptionMesssage set error code into options
func OptionNamespace ¶ added in v1.7.0
func OptionNamespace(ns string) OptionFunc
OptionNamespace set error code into options
func OptionStackTrace ¶ added in v1.7.0
func OptionStackTrace(stackTrace stack.Stack) OptionFunc
OptionStackTrace set error code into options
 Click to show internal directories. 
   Click to hide internal directories.