Move Healthcheck to middleware/pkg/healthcheck (#854)

* Move healthcheck out

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Move healthcheck to middleware/pkg/healthcheck

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2017-08-09 09:21:33 -07:00 committed by GitHub
parent 57692bbccf
commit a1b175ef78
9 changed files with 359 additions and 348 deletions

View file

@ -4,11 +4,13 @@ import (
"testing"
"time"
"github.com/coredns/coredns/middleware/pkg/healthcheck"
"google.golang.org/grpc/grpclog"
)
func pool() []*UpstreamHost {
return []*UpstreamHost{
func pool() []*healthcheck.UpstreamHost {
return []*healthcheck.UpstreamHost{
{
Name: "localhost:10053",
},
@ -22,13 +24,13 @@ func TestStartupShutdown(t *testing.T) {
grpclog.SetLogger(discard{})
upstream := &staticUpstream{
from: ".",
Hosts: pool(),
Policy: &Random{},
Spray: nil,
FailTimeout: 10 * time.Second,
Future: 60 * time.Second,
MaxFails: 1,
from: ".",
HealthCheck: healthcheck.HealthCheck{
Hosts: pool(),
FailTimeout: 10 * time.Second,
Future: 60 * time.Second,
MaxFails: 1,
},
}
g := newGrpcClient(nil, upstream)
upstream.ex = g