healthcheck

package
v0.27.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SectionDERP      string = "DERP"
	SectionAccessURL string = "AccessURL"
	SectionWebsocket string = "Websocket"
	SectionDatabase  string = "Database"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessURLReport added in v0.23.0

type AccessURLReport struct {
	AccessURL       string  `json:"access_url"`
	Healthy         bool    `json:"healthy"`
	Reachable       bool    `json:"reachable"`
	StatusCode      int     `json:"status_code"`
	HealthzResponse string  `json:"healthz_response"`
	Error           *string `json:"error"`
}

func (*AccessURLReport) Run added in v0.23.0

type AccessURLReportOptions added in v0.25.0

type AccessURLReportOptions struct {
	AccessURL *url.URL
	Client    *http.Client
}

type Checker added in v0.24.0

type DERPNodeReport

type DERPNodeReport struct {
	Healthy bool              `json:"healthy"`
	Node    *tailcfg.DERPNode `json:"node"`

	ServerInfo          derp.ServerInfoMessage `json:"node_info"`
	CanExchangeMessages bool                   `json:"can_exchange_messages"`
	RoundTripPing       time.Duration          `json:"round_trip_ping"`
	UsesWebsocket       bool                   `json:"uses_websocket"`
	ClientLogs          [][]string             `json:"client_logs"`
	ClientErrs          [][]string             `json:"client_errs"`
	Error               *string                `json:"error"`

	STUN DERPStunReport `json:"stun"`
	// contains filtered or unexported fields
}

func (*DERPNodeReport) Run

func (r *DERPNodeReport) Run(ctx context.Context)

type DERPRegionReport

type DERPRegionReport struct {
	Healthy bool `json:"healthy"`

	Region      *tailcfg.DERPRegion `json:"region"`
	NodeReports []*DERPNodeReport   `json:"node_reports"`
	Error       *string             `json:"error"`
	// contains filtered or unexported fields
}

func (*DERPRegionReport) Run

func (r *DERPRegionReport) Run(ctx context.Context)

type DERPReport

type DERPReport struct {
	Healthy bool `json:"healthy"`

	Regions map[int]*DERPRegionReport `json:"regions"`

	Netcheck     *netcheck.Report `json:"netcheck"`
	NetcheckErr  *string          `json:"netcheck_err"`
	NetcheckLogs []string         `json:"netcheck_logs"`

	Error *string `json:"error"`
}

func (*DERPReport) Run

func (r *DERPReport) Run(ctx context.Context, opts *DERPReportOptions)

type DERPReportOptions

type DERPReportOptions struct {
	DERPMap *tailcfg.DERPMap
}

type DERPStunReport

type DERPStunReport struct {
	Enabled bool
	CanSTUN bool
	Error   error
}

type DatabaseReport added in v0.25.0

type DatabaseReport struct {
	Healthy   bool          `json:"healthy"`
	Reachable bool          `json:"reachable"`
	Latency   time.Duration `json:"latency"`
	Error     *string       `json:"error"`
}

func (*DatabaseReport) Run added in v0.25.0

type DatabaseReportOptions added in v0.25.0

type DatabaseReportOptions struct {
	DB database.Store
}

type Report

type Report struct {
	// Time is the time the report was generated at.
	Time time.Time `json:"time"`
	// Healthy is true if the report returns no errors.
	Healthy bool `json:"healthy"`
	// FailingSections is a list of sections that have failed their healthcheck.
	FailingSections []string `json:"failing_sections"`

	DERP      DERPReport      `json:"derp"`
	AccessURL AccessURLReport `json:"access_url"`
	Websocket WebsocketReport `json:"websocket"`
	Database  DatabaseReport  `json:"database"`

	// The Coder version of the server that the report was generated on.
	CoderVersion string `json:"coder_version"`
}

func Run

func Run(ctx context.Context, opts *ReportOptions) *Report

type ReportOptions

type ReportOptions struct {
	DB database.Store
	// TODO: support getting this over HTTP?
	DERPMap   *tailcfg.DERPMap
	AccessURL *url.URL
	Client    *http.Client
	APIKey    string

	Checker Checker
}

type WebsocketEchoServer added in v0.24.0

type WebsocketEchoServer struct {
	Error error
	Code  int
}

func (*WebsocketEchoServer) ServeHTTP added in v0.24.0

func (s *WebsocketEchoServer) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type WebsocketReport

type WebsocketReport struct {
	Healthy  bool              `json:"healthy"`
	Response WebsocketResponse `json:"response"`
	Error    *string           `json:"error"`
}

func (*WebsocketReport) Run added in v0.23.0

type WebsocketReportOptions added in v0.24.0

type WebsocketReportOptions struct {
	APIKey     string
	AccessURL  *url.URL
	HTTPClient *http.Client
}

type WebsocketResponse added in v0.24.0

type WebsocketResponse struct {
	Body string `json:"body"`
	Code int    `json:"code"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy