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

@@ -32,7 +32,7 @@ func New() TCPProber {
type TCPProber struct{}
func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.Status, error) {
func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.Result, error) {
return DoTCPProbe(net.JoinHostPort(host, strconv.Itoa(port)), timeout)
}
@@ -40,7 +40,7 @@ func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.S
// If the socket can be opened, it returns Success
// If the socket fails to open, it returns Failure.
// This is exported because some other packages may want to do direct TCP probes.
func DoTCPProbe(addr string, timeout time.Duration) (probe.Status, error) {
func DoTCPProbe(addr string, timeout time.Duration) (probe.Result, error) {
conn, err := net.DialTimeout("tcp", addr, timeout)
if err != nil {
return probe.Failure, nil

View File

@@ -31,7 +31,7 @@ import (
func TestTcpHealthChecker(t *testing.T) {
prober := New()
tests := []struct {
expectedStatus probe.Status
expectedStatus probe.Result
usePort bool
expectError bool
}{