package
module
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Oct 26, 2018
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 9
Opens a new window with list of known importers.
README
¶
Service to handle recovery from panic events in Go
Installation
Run go get resenje.org/recovery
from command line.
Documentation
¶
type Notifier interface {
Notify(title, body string) error
}
Notifier defines interface to inject into Service for panic notifications.
type Service struct {
Version string
BuildInfo string
LogFunc func(...interface{})
Notifier Notifier
}
Service provides unified way of logging and notifying panic events.
Recover is a function that recovers from panic, logs and notifies event.
It should be used as an argument to defer statement:
recoveryService := &recovery.Service{...}
go func() {
defer recoveryService.Recover()
...
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.