Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
type HealthCheck struct {
url.URL
// HealthCheckPollInterval is the interval which will be used for polling the
// endpoint described by Host, Port, and Path.
//
// If left empty it will default to 100 Milliseconds.
PollInterval time.Duration
}
HealthCheck describes the information needed to health-check a process via some health-check URL.
type ListenAddr ¶
ListenAddr represents some listening address and port.
func (*ListenAddr) HostPort ¶
func (l *ListenAddr) HostPort() string
HostPort returns the joined host-port pair for this address.
type State ¶
type State struct {
Cmd *exec.Cmd
// HealthCheck describes how to check if this process is up. If we get an http.StatusOK,
// we assume the process is ready to operate.
//
// For example, the /healthz endpoint of the k8s API server, or the /health endpoint of etcd.
HealthCheck *HealthCheck
Dir string
Args []string
Env []string
StopTimeout time.Duration
StartTimeout time.Duration
Path string
// contains filtered or unexported fields
}
State define the state of the process.
func (*State) CheckFlag ¶
CheckFlag checks the help output of this command for the presence of the given flag, specified without the leading `--` (e.g. `CheckFlag("insecure-port")` checks for `--insecure-port`), returning true if the flag is present.
func (*State) Exited ¶
Exited returns true if the process exited, and may also return an error (as per Cmd.Wait) if the process did not exit with error code 0.
func (*State) Init ¶
Init sets up this process, configuring binary paths if missing, initializing temporary directories, etc.
This defaults all defaultable fields.