replace email processing reactions; update deps
This commit is contained in:
24
vendor/gitlab.com/etke.cc/go/healthchecks/v2/healthchecks.go
generated
vendored
24
vendor/gitlab.com/etke.cc/go/healthchecks/v2/healthchecks.go
generated
vendored
@@ -6,12 +6,19 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
// DefaultAPI base url for checks
|
||||
const DefaultAPI = "https://hc-ping.com"
|
||||
const (
|
||||
// DefaultAPI base url for checks
|
||||
DefaultAPI = "https://hc-ping.com"
|
||||
// DefaultUserAgent for the client
|
||||
DefaultUserAgent = "Go-Healthchecks (lib; +https://gitlab.com/etke.cc/go/healthchecks)"
|
||||
)
|
||||
|
||||
// ErrLog used to log errors occurred during an operation
|
||||
type ErrLog func(operation string, err error)
|
||||
|
||||
// global client
|
||||
var global *Client
|
||||
|
||||
// DefaultErrLog if you don't provide one yourself
|
||||
var DefaultErrLog = func(operation string, err error) {
|
||||
fmt.Printf("healtchecks operation %q failed: %v\n", operation, err)
|
||||
@@ -25,5 +32,18 @@ func New(options ...Option) *Client {
|
||||
}
|
||||
c.init(options...)
|
||||
|
||||
if global == nil {
|
||||
global = c
|
||||
}
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
// Global healthchecks client
|
||||
func Global() *Client {
|
||||
if global == nil {
|
||||
global = New()
|
||||
}
|
||||
|
||||
return global
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user