internal

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg = struct {
	Pkg         string
	Debug       bool
	MaxObj      uint8
	MaxRetryDur time.Duration
}{
	Pkg:         "errors",
	Debug:       true,
	MaxObj:      15,
	MaxRetryDur: time.Hour * 24,
}

default config

Functions

func Assert

func Assert()

func AssertFn

func AssertFn(fn reflect.Value) error

func Blue

func Blue(s string) string

func Cyan

func Cyan(s string) string

func Debug

func Debug()

func ErrHandle

func ErrHandle(err interface{}, fn ...func(err *Err))

func ErrLog

func ErrLog(err interface{})

func ErrTagRegistry

func ErrTagRegistry(tag string)

func ErrTags

func ErrTags() map[string]bool

func ErrTagsMatch

func ErrTagsMatch(tag string) bool

func FuncCaller

func FuncCaller(callDepth int) string

func GetCallerFromFn

func GetCallerFromFn(fn reflect.Value) string

func Green

func Green(s string) string

func If

func If(b bool, t, f interface{}) interface{}

func InitDebug added in v0.3.3

func InitDebug()

func IsDebug added in v0.3.3

func IsDebug() bool

func IsNone

func IsNone(val interface{}) bool

func IsZero

func IsZero(val reflect.Value) bool

func Magenta

func Magenta(s string) string

func P

func P(d ...interface{})

func Panic

func Panic(err interface{})

func Red

func Red(s string) string

func Resp

func Resp(fn func(err *Err))

func Retry

func Retry(num int, fn func()) (err error)

func RetryAt

func RetryAt(t time.Duration, fn func(at time.Duration))

func T

func T(b bool, msg string, args ...interface{})

func TestRun

func TestRun(fn interface{}, desc func(desc func(string) *Test))

func Throw

func Throw(fn interface{})

func Ticker

func Ticker(fn func(dur time.Time) time.Duration)

func Try

func Try(fn interface{}) func(...interface{}) func(...interface{}) (err error)

func TryRaw

func TryRaw(fn reflect.Value) func(...reflect.Value) func(...reflect.Value) (err error)

func White

func White(s string) string

func Wrap

func Wrap(err interface{}, msg string, args ...interface{})

func Yellow

func Yellow(s string) string

Types

type Err

type Err struct {
	// contains filtered or unexported fields
}

func TT

func TT(b bool, msg string, args ...interface{}) *Err

func WrapM

func WrapM(err interface{}, msg string, args ...interface{}) *Err

func (*Err) Caller

func (t *Err) Caller(caller string) *Err

func (*Err) Done

func (t *Err) Done()

func (*Err) Err

func (t *Err) Err() error

func (*Err) Error

func (t *Err) Error() string

func (*Err) M

func (t *Err) M(k string, v interface{}) *Err

func (*Err) P

func (t *Err) P() string

func (*Err) SetTag

func (t *Err) SetTag(tag string) *Err

func (*Err) StackTrace

func (t *Err) StackTrace() *_Err

func (*Err) Tag

func (t *Err) Tag() string

type Test

type Test struct {
	// contains filtered or unexported fields
}

func (*Test) In

func (t *Test) In(args ...interface{}) *Test

func (*Test) IsErr

func (t *Test) IsErr(fn ...interface{})

func (*Test) IsNil

func (t *Test) IsNil(fn ...interface{})

Jump to

Keyboard shortcuts

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