Documentation
¶
Overview ¶
Package status is the commands that report on anfra itself: version, and status of the warm server and its sidecars.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Status = command.Define(command.Def[command.NoInput, StatusResult]{ Name: "status", Short: "Report whether a warm server is running and its sidecars are healthy", ReadOnly: true, Run: func(ctx context.Context, cc command.CommandContext, _ command.NoInput) (StatusResult, error) { r := checkStatus(ctx, cc.Clients) r.Server = cc.Server return r, nil }, Valid: func(r StatusResult) bool { return r.State == StateHealthy }, })
Status reports whether a warm server is running and its sidecars are healthy.
View Source
var Version = command.Define(command.Def[command.NoInput, VersionResult]{ Name: "version", Short: "Print the anfra version", ReadOnly: true, Run: func(_ context.Context, cc command.CommandContext, _ command.NoInput) (VersionResult, error) { r := VersionResult{Version: meta.Version} if cc.Update != nil { r.Update = cc.Update() } return r, nil }, })
Version prints the anfra version.
Functions ¶
This section is empty.
Types ¶
type SidecarHealth ¶
SidecarHealth is each sidecar's health: "ok" or the error message.
type StatusResult ¶
type StatusResult struct {
State State `json:"state" enum:"healthy,degraded,not_running"`
Server *command.ServerInfo `json:"server,omitempty"`
Sidecars *SidecarHealth `json:"sidecars,omitempty"`
}
StatusResult is the `status` result: the warm server's state and, when it is running, where it is and its sidecars' health.
type VersionResult ¶
type VersionResult struct {
Version string `json:"version"`
// Update is the newest release the host knows of; absent when it does not
// check for updates or has not checked yet.
Update *command.UpdateInfo `json:"update,omitempty"`
}
VersionResult is the `version` result.
Click to show internal directories.
Click to hide internal directories.