replace email processing reactions; update deps

This commit is contained in:
Aine
2024-04-30 09:18:04 +03:00
parent 15d61f174e
commit 0e3655195a
35 changed files with 709 additions and 247 deletions

View File

@@ -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
}