assert

package module
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 12 Imported by: 14

README

assert

assert for go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFn added in v0.1.20

func AssertFn(fn interface{})

func ErrWrap added in v0.1.4

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

func FnCost added in v0.1.17

func FnCost(f func()) time.Duration

func For added in v0.1.21

func For(fn func() bool, efn ...func(err error))

func If added in v0.0.4

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

func IfEquals added in v0.0.4

func IfEquals(args ...interface{}) bool

func IfIn added in v0.0.4

func IfIn(a interface{}, args ...interface{}) bool

func IfNotIn added in v0.0.4

func IfNotIn(a interface{}, args ...interface{}) bool

func IsAllNil added in v0.1.15

func IsAllNil(args ...interface{}) bool

func IsAllNotNil added in v0.1.15

func IsAllNotNil(args ...interface{}) bool

func IsErr added in v0.1.20

func IsErr(p interface{}) bool

func IsNil added in v0.1.15

func IsNil(p interface{}) (b bool)

func IsPtr added in v0.1.20

func IsPtr(p interface{}) bool

func KTry added in v0.1.15

func KTry(fn interface{}, args ...interface{}) (err error)

func NewTask added in v0.1.17

func NewTask(max int, maxDur time.Duration) *task

func ObjOf added in v0.1.15

func ObjOf(args ...interface{}) []interface{}

func P

func P(d ...interface{})

func Retry added in v0.1.17

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

func SWrap added in v0.1.13

func SWrap(err error, fn func(m *M))

func StrOf added in v0.1.15

func StrOf(args ...string) []string

func T added in v0.1.13

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

func TT added in v0.1.21

func TT(b bool, fn func(m *M))

func Throw added in v0.1.12

func Throw(err error)

func Ticker added in v0.1.17

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

func ToInt added in v0.1.15

func ToInt(p string) int

func Try added in v0.1.15

func Try(fn interface{}, args ...interface{}) (r interface{})

func WaitFor added in v0.1.17

func WaitFor(fn func(dur time.Duration) bool)

Types

type FnT added in v0.1.15

type FnT func() []reflect.Value

func FnOf added in v0.1.15

func FnOf(fn interface{}, args ...interface{}) FnT

type KErr added in v0.0.13

type KErr struct {
	Tag    string                 `json:"tag,omitempty"`
	M      map[string]interface{} `json:"m,omitempty"`
	Err    error                  `json:"err,omitempty"`
	Msg    string                 `json:"msg,omitempty"`
	Caller string                 `json:"caller,omitempty"`
	Sub    *KErr                  `json:"sub,omitempty"`
}

func (*KErr) Error added in v0.0.13

func (t *KErr) Error() string

func (*KErr) P added in v0.1.4

func (t *KErr) P()

func (*KErr) Panic added in v0.1.3

func (t *KErr) Panic()

func (*KErr) StackTrace added in v0.1.11

func (t *KErr) StackTrace() interface{}

type M added in v0.1.12

type M struct {
	M map[string]interface{}
	// contains filtered or unexported fields
}

func (*M) Msg added in v0.1.12

func (t *M) Msg(format string, args ...interface{})

func (*M) Tag added in v0.1.12

func (t *M) Tag(tag string)

type TaskFn added in v0.1.17

type TaskFn func(args ...interface{}) *_task_fn

func TaskOf added in v0.1.20

func TaskOf(fn interface{}, efn ...func(err error)) TaskFn

Jump to

Keyboard shortcuts

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