rename probe.Status to probe.Result.

This commit is contained in:
Mike Danese
2015-01-30 17:03:57 -08:00
parent 8e6f5c7201
commit 14bfec92f2
14 changed files with 22 additions and 23 deletions

View File

@@ -38,7 +38,7 @@ type HTTPProber struct {
}
// Probe returns a ProbeRunner capable of running an http check.
func (pr *HTTPProber) Probe(host string, port int, path string, timeout time.Duration) (probe.Status, error) {
func (pr *HTTPProber) Probe(host string, port int, path string, timeout time.Duration) (probe.Result, error) {
return DoHTTPProbe(formatURL(host, port, path), &http.Client{Timeout: timeout, Transport: pr.transport})
}
@@ -50,7 +50,7 @@ type HTTPGetInterface interface {
// If the HTTP response code is successful (i.e. 400 > code >= 200), it returns Success.
// If the HTTP response code is unsuccessful or HTTP communication fails, it returns Failure.
// This is exported because some other packages may want to do direct HTTP probes.
func DoHTTPProbe(url string, client HTTPGetInterface) (probe.Status, error) {
func DoHTTPProbe(url string, client HTTPGetInterface) (probe.Result, error) {
res, err := client.Get(url)
if err != nil {
glog.V(1).Infof("HTTP probe error: %v", err)

View File

@@ -54,7 +54,7 @@ func TestHTTPProbeChecker(t *testing.T) {
prober := New()
testCases := []struct {
handler func(w http.ResponseWriter)
health probe.Status
health probe.Result
}{
// The probe will be filled in below. This is primarily testing that an HTTP GET happens.
{handleReq(http.StatusOK), probe.Success},