MCPcopy Create free account
hub / github.com/efficientgo/e2e / Ready

Method Ready

env.go:356–370  ·  view source on GitHub ↗
(runnable Runnable)

Source from the content-addressed store, hash-verified

354}
355
356func (p *TCPReadinessProbe) Ready(runnable Runnable) (err error) {
357 endpoint := runnable.Endpoint(p.portName)
358 if endpoint == "" {
359 return errors.Newf("cannot get service endpoint for port %s", p.portName)
360 } else if endpoint == "stopped" {
361 return errors.New("service has stopped")
362 }
363
364 conn, err := net.DialTimeout("tcp", endpoint, time.Second)
365 if err != nil {
366 return err
367 }
368
369 return conn.Close()
370}
371
372// CmdReadinessProbe checks readiness by `Exec`ing a command (within container) which returns 0 to consider status being ready.
373type CmdReadinessProbe struct {

Callers

nothing calls this directly

Calls 2

EndpointMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected