healthsdk
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Variables
- type AccessURLReport
- type AgentNetcheckReport
- type BaseReport
- type ClientNetcheckReport
- type DERPHealthReport
- type DERPNodeReport
- type DERPRegionReport
- type DatabaseReport
- type HealthClient
- type HealthSection
- type HealthSettings
- type HealthcheckReport
- type Interface
- type InterfacesReport
- type ProvisionerDaemonsReport
- type ProvisionerDaemonsReportItem
- type STUNReport
- type UpdateHealthSettings
- type WebsocketReport
- type WorkspaceProxyReport
Constants¶
This section is empty.
Variables¶
Functions¶
This section is empty.
Types¶
typeAccessURLReport¶
type AccessURLReport struct {BaseReport// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`AccessURLstring `json:"access_url"`Reachablebool `json:"reachable"`StatusCodeint `json:"status_code"`HealthzResponsestring `json:"healthz_response"`}
AccessURLReport shows the results of performing a HTTP_GET to the /healthz endpoint through the configured access URL.
typeAgentNetcheckReport¶added inv2.15.0
type AgentNetcheckReport struct {BaseReportNetInfo *tailcfg.NetInfo `json:"net_info"`InterfacesInterfacesReport `json:"interfaces"`}
@typescript-ignore AgentNetcheckReport
typeBaseReport¶added inv2.11.0
type BaseReport struct {Error *string `json:"error,omitempty"`Severityhealth.Severity `json:"severity" enums:"ok,warning,error"`Warnings []health.Message `json:"warnings"`Dismissedbool `json:"dismissed"`}
BaseReport holds fields common to various health reports.
func (*BaseReport)Summarize¶added inv2.11.0
func (b *BaseReport) Summarize(prefix, docsURLstring) []string
Summarize returns a list of strings containing the errors and warnings of BaseReport, if present.All strings are prefixed with prefix.
typeClientNetcheckReport¶added inv2.13.0
type ClientNetcheckReport struct {DERPDERPHealthReport `json:"derp"`InterfacesInterfacesReport `json:"interfaces"`}
@typescript-ignore ClientNetcheckReport
typeDERPHealthReport¶
type DERPHealthReport struct {BaseReport// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`Regions map[int]*DERPRegionReport `json:"regions"`Netcheck *netcheck.Report `json:"netcheck,omitempty"`NetcheckErr *string `json:"netcheck_err,omitempty"`NetcheckLogs []string `json:"netcheck_logs"`}
DERPHealthReport includes health details of each configured DERP/STUN region.
typeDERPNodeReport¶
type DERPNodeReport struct {// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`Severityhealth.Severity `json:"severity" enums:"ok,warning,error"`Warnings []health.Message `json:"warnings"`Error *string `json:"error,omitempty"`Node *tailcfg.DERPNode `json:"node"`ServerInfoderp.ServerInfoMessage `json:"node_info"`CanExchangeMessagesbool `json:"can_exchange_messages"`RoundTripPingstring `json:"round_trip_ping"`RoundTripPingMsint `json:"round_trip_ping_ms"`UsesWebsocketbool `json:"uses_websocket"`ClientLogs [][]string `json:"client_logs"`ClientErrs [][]string `json:"client_errs"`STUNSTUNReport `json:"stun"`}
DERPHealthReport includes health details of a single node in a single region.
typeDERPRegionReport¶
type DERPRegionReport struct {// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`Severityhealth.Severity `json:"severity" enums:"ok,warning,error"`Warnings []health.Message `json:"warnings"`Error *string `json:"error,omitempty"`Region *tailcfg.DERPRegion `json:"region"`NodeReports []*DERPNodeReport `json:"node_reports"`}
DERPHealthReport includes health details of each node in a single region.
typeDatabaseReport¶
type DatabaseReport struct {BaseReport// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`Reachablebool `json:"reachable"`Latencystring `json:"latency"`LatencyMSint64 `json:"latency_ms"`ThresholdMSint64 `json:"threshold_ms"`}
DatabaseReport shows the results of pinging the configured database.Conn.
typeHealthClient¶
type HealthClient struct {// contains filtered or unexported fields}
@typescript-ignore HealthClient
funcNew¶
func New(c *codersdk.Client) *HealthClient
func (*HealthClient)DebugHealth¶
func (c *HealthClient) DebugHealth(ctxcontext.Context) (HealthcheckReport,error)
func (*HealthClient)HealthSettings¶
func (c *HealthClient) HealthSettings(ctxcontext.Context) (HealthSettings,error)
func (*HealthClient)PutHealthSettings¶
func (c *HealthClient) PutHealthSettings(ctxcontext.Context, settingsHealthSettings)error
typeHealthSection¶
type HealthSectionstring
const (HealthSectionDERPHealthSection = "DERP"HealthSectionAccessURLHealthSection = "AccessURL"HealthSectionWebsocketHealthSection = "Websocket"HealthSectionDatabaseHealthSection = "Database"HealthSectionWorkspaceProxyHealthSection = "WorkspaceProxy"HealthSectionProvisionerDaemonsHealthSection = "ProvisionerDaemons")
If you add another const below, make sure to add it to HealthSections!
typeHealthSettings¶
type HealthSettings struct {DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`}
typeHealthcheckReport¶
type HealthcheckReport struct {// Time is the time the report was generated at.Timetime.Time `json:"time" format:"date-time"`// Healthy is true if the report returns no errors.// Deprecated: use `Severity` insteadHealthybool `json:"healthy"`// Severity indicates the status of Coder health.Severityhealth.Severity `json:"severity" enums:"ok,warning,error"`DERPDERPHealthReport `json:"derp"`AccessURLAccessURLReport `json:"access_url"`WebsocketWebsocketReport `json:"websocket"`DatabaseDatabaseReport `json:"database"`WorkspaceProxyWorkspaceProxyReport `json:"workspace_proxy"`ProvisionerDaemonsProvisionerDaemonsReport `json:"provisioner_daemons"`// The Coder version of the server that the report was generated on.CoderVersionstring `json:"coder_version"`}
HealthcheckReport contains information about the health status of a Coder deployment.
func (*HealthcheckReport)Summarize¶added inv2.11.0
func (r *HealthcheckReport) Summarize(docsURLstring) []string
Summarize returns a summary of all errors and warnings of components of HealthcheckReport.
typeInterface¶added inv2.13.0
type Interface struct {Namestring `json:"name"`MTUint `json:"mtu"`Addresses []string `json:"addresses"`}
@typescript-ignore Interface
typeInterfacesReport¶added inv2.13.0
type InterfacesReport struct {BaseReportInterfaces []Interface `json:"interfaces"`}
@typescript-ignore InterfacesReport
funcRunInterfacesReport¶added inv2.13.0
func RunInterfacesReport() (InterfacesReport,error)
typeProvisionerDaemonsReport¶
type ProvisionerDaemonsReport struct {BaseReportItems []ProvisionerDaemonsReportItem `json:"items"`}
ProvisionerDaemonsReport includes health details of each connected provisioner daemon.
typeProvisionerDaemonsReportItem¶
type ProvisionerDaemonsReportItem struct {codersdk.ProvisionerDaemon `json:"provisioner_daemon"`Warnings []health.Message `json:"warnings"`}
typeSTUNReport¶
STUNReport contains information about a given node's STUN capabilities.
typeUpdateHealthSettings¶
type UpdateHealthSettings struct {DismissedHealthchecks []HealthSection `json:"dismissed_healthchecks"`}
typeWebsocketReport¶
type WebsocketReport struct {// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`BaseReportBodystring `json:"body"`Codeint `json:"code"`}
WebsocketReport shows if the configured access URL allows establishing WebSocket connections.
typeWorkspaceProxyReport¶
type WorkspaceProxyReport struct {// Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead.Healthybool `json:"healthy"`BaseReportWorkspaceProxiescodersdk.RegionsResponse[codersdk.WorkspaceProxy] `json:"workspace_proxies"`}
WorkspaceProxyReport includes health details of each connected workspace proxy.