Documentation ¶
Index ¶
- Variables
- func Call(callers ...errCaller) error
- func GetMem() uint64
- func HandleCrash(additionalHandlers ...func(interface{}))
- func HandleError(err error, fn func(err error))
- func HandleNil[T any](pointer *T, fn func(notNilPointer *T))
- func IgnoreErrorCaller(caller errCaller) func()
- func SetReallyCrash(really bool)
- func ShowMemoryUsage()
- func Shutdown(callback func())
- func WaitClose(stop <-chan struct{}, closeFunc ...func())
- type ChanWatcher
- type Runnable
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var PanicHandlers = []func(interface{}){logPanic}
Functions ¶
func Call ¶
func Call(callers ...errCaller) error
Call 同步依次执行函数,只要有一个返回err,直接返回 通过此方法可以减少if err != nil { return }的判断
func HandleCrash ¶
func HandleCrash(additionalHandlers ...func(interface{}))
func HandleError ¶ added in v1.1.4
func IgnoreErrorCaller ¶ added in v1.1.4
func IgnoreErrorCaller(caller errCaller) func()
IgnoreErrorCaller return new function that will ignore error
func SetReallyCrash ¶
func SetReallyCrash(really bool)
func ShowMemoryUsage ¶ added in v1.1.4
func ShowMemoryUsage()
Types ¶
type ChanWatcher ¶ added in v1.1.4
type ChanWatcher struct {
// contains filtered or unexported fields
}
ChanWatcher implements the Watcher interface with channel.
func NewWatcher ¶ added in v1.1.4
func NewWatcher(chs ...chan struct{}) *ChanWatcher
func (*ChanWatcher) Stop ¶ added in v1.1.4
func (w *ChanWatcher) Stop()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.