Fix golint for pkg/probe

This change adds comments to exported things and renames the tcp,
http, and exec probe interfaces to just be Prober within their
namespace.

Issue #68026
This commit is contained in:
Jon Friesen
2018-09-12 14:13:19 -07:00
parent 426ef9d349
commit b971c3e200
7 changed files with 31 additions and 21 deletions

View File

@@ -26,16 +26,19 @@ import (
"github.com/golang/glog"
)
func New() TCPProber {
// New creates Prober.
func New() Prober {
return tcpProber{}
}
type TCPProber interface {
// Prober is an interface that defines the Probe function for doing TCP readiness/liveness checks.
type Prober interface {
Probe(host string, port int, timeout time.Duration) (probe.Result, string, error)
}
type tcpProber struct{}
// Probe returns a ProbeRunner capable of running an TCP check.
func (pr tcpProber) Probe(host string, port int, timeout time.Duration) (probe.Result, string, error) {
return DoTCPProbe(net.JoinHostPort(host, strconv.Itoa(port)), timeout)
}