1
0
Fork 0

Add global health check interval parameter.

The new parameter allows to set a health check interval valid for all
backends. Custom values set per provider may override the global one.
This commit is contained in:
Timo Reimann 2017-03-24 09:36:33 +01:00
parent ce492895e2
commit 25345427c3
6 changed files with 71 additions and 12 deletions

View file

@ -2,6 +2,7 @@ package healthcheck
import (
"context"
"fmt"
"net/http"
"net/url"
"sync"
@ -12,9 +13,6 @@ import (
"github.com/vulcand/oxy/roundrobin"
)
// DefaultInterval is the default health check interval.
const DefaultInterval = 30 * time.Second
var singleton *HealthCheck
var once sync.Once
@ -33,6 +31,10 @@ type Options struct {
LB LoadBalancer
}
func (opt Options) String() string {
return fmt.Sprintf("[Path: %s Interval: %s]", opt.Path, opt.Interval)
}
// BackendHealthCheck HealthCheck configuration for a backend
type BackendHealthCheck struct {
Options