Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrorLog func(err error)
Set ErrorLog to report errors to your logging system
Functions ¶
func DbOpen ¶
DbOpen is a utility method that connects to a Database, and Ping's the database, permitting really easy data connection. It runs a standard golly.Run function to ensure that the connection MUST succeed before this function will return.
func RetryWithBackoff ¶
RetryWithBackoff is the default retry handler for golly. The default handler will retry indefinitely, with backoff waits between attempts of 1, 2, 4, 8, 16 and ultimately 32s.
Types ¶
type Golly ¶
type Golly struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Golly
New returns a new golly struct configured with a default retry handler of RetryWithBackoff. The golly functions will automatically call New() for you, so there's no necessity to use New() yourself for basic golly usage.
func (*Golly) Panic ¶
Panic sets the panic handler on the Golly struct. The panic handler will be called if the function that is Run panics. If the panic handler returns an error, golly's wait handler will receive the error and handle it as it would any other error.
func (*Golly) Retry ¶
func (g *Golly) Retry(retry func(err error, errorCount int, lastWait time.Duration) (time.Duration, error)) *Golly
Retry sets the retry handler. The retry handler determines whether golly should retry the Run function, or exit with an error. If the retry handler returns an error, golly's Run method returns the error. If it returns a nil error and a time.Duration, golly will wait for the duration, then retry the function.