本文整理汇总了Golang中k8s/io/kubernetes/pkg/probe/http.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: newProber
// NewProber creates a Prober, it takes a command runner and
// several container info managers.
func newProber(
runner kubecontainer.ContainerCommandRunner,
refManager *kubecontainer.RefManager,
recorder record.EventRecorder) *prober {
return &prober{
exec: execprobe.New(),
http: httprobe.New(),
tcp: tcprobe.New(),
runner: runner,
refManager: refManager,
recorder: recorder,
}
}
示例2: healthzProxyTest
func healthzProxyTest(masterConfig *configapi.MasterConfig, t *testing.T) {
// Ping the healthz endpoint on the second OpenShift cluster
url, err := url.Parse(masterConfig.MasterPublicURL)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
url.Path = "/healthz"
response, body, err := httpprobe.New().Probe(url, 1*time.Second)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if response != probe.Success {
t.Fatalf("Server reported unhealthy: %v", body)
}
}
示例3: NewStorage
// NewStorage returns a new REST.
func NewStorage(serverRetriever func() map[string]apiserver.Server) *REST {
return &REST{
GetServersToValidate: serverRetriever,
prober: httpprober.New(),
}
}