Documentation ¶
Index ¶
- func RecoverPanic(logger logrus.FieldLogger)
- type DeferFunc
- type DeferList
- func (list *DeferList) Defer(name string, fn func() error)
- func (list *DeferList) DeferContext(name string, fn func(context.Context) error)
- func (list *DeferList) DeferContextWithLock(name string, fn func(ctx context.Context) error)
- func (list *DeferList) DeferWithLock(name string, fn func() error)
- func (list *DeferList) LockedRun(ctx context.Context, logger logrus.FieldLogger) (string, error)
- func (list *DeferList) Run(ctx context.Context, logger logrus.FieldLogger) (string, error)
- func (list *DeferList) RunWithChannel(ctx context.Context, logger logrus.FieldLogger, ch chan<- error)
- type ShutdownTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecoverPanic ¶
func RecoverPanic(logger logrus.FieldLogger)
Types ¶
type DeferList ¶
type DeferList struct {
// contains filtered or unexported fields
}
func NewDeferList ¶
func NewDeferList() *DeferList
func (*DeferList) DeferContext ¶
func (*DeferList) DeferContextWithLock ¶
func (*DeferList) DeferWithLock ¶
func (*DeferList) Run ¶
Run runs the defer list. Should be called from the Close function of components. Returns a nonempty string containing the defer message and the error that occurred upon error. Returns empty string and nil error upon success.
func (*DeferList) RunWithChannel ¶
type ShutdownTrigger ¶
type ShutdownTrigger struct {
Trigger context.CancelFunc
}
func ContextWithTrigger ¶
func ContextWithTrigger(ctx context.Context) (context.Context, *ShutdownTrigger)
func (*ShutdownTrigger) SetupSignalHandler ¶
func (trigger *ShutdownTrigger) SetupSignalHandler()
Click to show internal directories.
Click to hide internal directories.