Documentation
¶
Index ¶
- Constants
- Variables
- func AddErrorsCodes(m map[int]string)
- func GetStack() string
- func RvGet() int64
- func RvGetPart() int64
- type Error
- func ErrorCE(code int, err error) *Error
- func ErrorCS(code int, err string) *Error
- func ErrorCSE(code int, err string, internalError error) *Error
- func ErrorCSEf(code int, internalError error, format string, a ...interface{}) *Error
- func ErrorCSf(code int, format string, a ...interface{}) *Error
- func ErrorE(err error) *Error
- func ErrorNew(msg string, internalError error) *Error
- func ErrorNew2(msg string, internalError error, internal2Error error) *Error
- func ErrorNew2f(internalError error, internal2Error error, format string, a ...interface{}) *Error
- func ErrorNewf(internalError error, format string, a ...interface{}) *Error
- func ErrorS(err string) *Error
- func ErrorSf(format string, a ...interface{}) *Error
- func GenerateError(key int, a ...interface{}) *Error
- func GenerateErrorE(key int, err error, a ...interface{}) *Error
- func GenerateErrorSubList(key int, sub []*Error, a ...interface{}) *Error
- func (e *Error) AppendE(errs error) *Error
- func (e *Error) AppendLabel(name ErrorLabelName, value string) *Error
- func (e *Error) AppendLabels(labels map[ErrorLabelName]string) *Error
- func (e *Error) AppendList(sub ...*Error) (eOut *Error)
- func (e *Error) AppendS(errs string) *Error
- func (e *Error) AppendSf(format string, a ...interface{}) *Error
- func (e *Error) Error() string
- func (e *Error) GetLabel(name ErrorLabelName) (value string, ok bool)
- func (e *Error) GetLabelOrDefailt(name ErrorLabelName, defaultValue string) (value string)
- type ErrorLabelName
- type ErrorProvider
- type G
Constants ¶
View Source
const ErrorCommonCode int = 50000
ErrorCommonCode - no code error
Variables ¶
View Source
var ErrorsCodes map[int]string = map[int]string{
50000: "Undescribe error",
}
View Source
var FillCallStack bool = false
View Source
var InnerErrorPrefix string = " "
Functions ¶
func AddErrorsCodes ¶ added in v0.2.1
Types ¶
type Error ¶
type Error struct {
Code int `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
InternalErrorText string `json:"iet,omitempty"`
InternalError *Error `json:"ie,omitempty"`
InternalErrors []*Error `json:"ies,omitempty"`
CallStack string `json:"call_stack,omitempty"`
Labels map[ErrorLabelName]string `json:"labels,omitempty"`
}
Error type with internal
func ErrorNew2f ¶ added in v0.1.2
ErrorNew2f - Create new Error
func GenerateError ¶ added in v0.2.1
GenerateError - generate error with code
func GenerateErrorE ¶ added in v0.2.1
GenerateErrorE - generate error with code and exists error
func GenerateErrorSubList ¶ added in v0.2.1
GenerateErrorSubList -
func (*Error) AppendLabel ¶ added in v0.2.2
func (e *Error) AppendLabel(name ErrorLabelName, value string) *Error
func (*Error) AppendLabels ¶ added in v0.2.2
func (e *Error) AppendLabels(labels map[ErrorLabelName]string) *Error
func (*Error) AppendList ¶ added in v0.2.0
func (*Error) GetLabel ¶ added in v0.2.2
func (e *Error) GetLabel(name ErrorLabelName) (value string, ok bool)
func (*Error) GetLabelOrDefailt ¶ added in v0.2.2
func (e *Error) GetLabelOrDefailt(name ErrorLabelName, defaultValue string) (value string)
type ErrorLabelName ¶ added in v0.2.2
type ErrorLabelName string
type ErrorProvider ¶
type ErrorProvider interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warningf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Fatalf(format string, args ...interface{})
Panicf(format string, args ...interface{})
Debug(args ...interface{})
Info(args ...interface{})
Warning(args ...interface{})
Error(args ...interface{})
Fatal(args ...interface{})
Panic(args ...interface{})
Debugln(args ...interface{})
Infoln(args ...interface{})
Warningln(args ...interface{})
Errorln(args ...interface{})
Fatalln(args ...interface{})
Panicln(args ...interface{})
}
ErrorProvider interface for error provider mostly for background processes
type G ¶
type G struct {
AddValue int64 `json:"generator_add_value,omitempty"`
// contains filtered or unexported fields
}
G Generator
func (*G) RvGetOrGlobal ¶ added in v0.2.3
RvGet2 - Generate Next RV (sync) global is used if g == nil
func (*G) RvGetPartOrGlobal ¶ added in v0.2.3
RvGetPartOrGlobal - Generate Next RV (sync) partitioned by (x%10000)/10 global is used if g == nil
Source Files
¶
Click to show internal directories.
Click to hide internal directories.