model

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckDetails added in v0.12.0

type CheckDetails interface {
	// contains filtered or unexported methods
}

CheckDetails carries check-type-specific observations alongside a check Result. They are exported as metrics only when check.detailed_metrics is enabled for the VIP; otherwise they are only visible in the ad-hoc check response.

type CheckStatus added in v0.12.0

type CheckStatus struct {
	Name            string       `json:"name"`
	Type            string       `json:"type"`
	Health          HealthStatus `json:"health"`
	HealthName      string       `json:"health_name"`
	ConsecutiveOK   int          `json:"consecutive_ok"`
	ConsecutiveFail int          `json:"consecutive_fail"`
	LastSuccess     bool         `json:"last_success"`
	LastDetail      string       `json:"last_detail"`
	LastTime        time.Time    `json:"last_time"`
}

CheckStatus is the observable state of one check of a VIP.

type DNSDetails added in v0.12.0

type DNSDetails struct {
	Names []DNSNameDetails `json:"names"`
}

DNSDetails is reported by the dns checker for every name that got a reply.

type DNSNameDetails added in v0.12.0

type DNSNameDetails struct {
	Name    string `json:"name"`
	Rcode   int    `json:"rcode"`
	Answers int    `json:"answers"`
}

DNSNameDetails is one queried name within DNSDetails.

type DaemonStatus

type DaemonStatus struct {
	RouterID  string       `json:"router_id"`
	ASN       uint32       `json:"asn"`
	Version   string       `json:"version"`
	Commit    string       `json:"commit"`
	StartTime time.Time    `json:"start_time"`
	Peers     []PeerStatus `json:"peers"`
	VIPs      []VIPStatus  `json:"vips"`
}

DaemonStatus is the full daemon state returned on the diagnostic endpoint.

type GRPCDetails added in v0.12.0

type GRPCDetails struct {
	// gRPC status code of the call (0 = OK).
	StatusCode uint32 `json:"status_code"`
	// Serving status from the standard health protocol; empty for custom methods.
	ServingStatus string `json:"serving_status,omitempty"`
}

GRPCDetails is reported by the grpc checker.

type HTTPDetails added in v0.12.0

type HTTPDetails struct {
	StatusCode int `json:"status_code"`
	// NotAfter of the leaf certificate presented by the server; zero for plain HTTP.
	TLSCertNotAfter time.Time `json:"tls_cert_not_after,omitzero"`
}

HTTPDetails is reported by the http checker once a response was received.

type HealthStatus

type HealthStatus int

HealthStatus tracks whether a VIP's service is considered healthy.

const (
	HealthUnknown   HealthStatus = 0
	HealthHealthy   HealthStatus = 1
	HealthUnhealthy HealthStatus = 2
)

func (HealthStatus) String

func (h HealthStatus) String() string

type KafkaDetails added in v0.13.0

type KafkaDetails struct {
	ClusterID               string `json:"cluster_id"`
	Controller              int32  `json:"controller"`
	Brokers                 int    `json:"brokers"`
	Topic                   string `json:"topic,omitempty"`
	Partitions              int    `json:"partitions,omitempty"`
	PartitionsWithoutLeader int    `json:"partitions_without_leader,omitempty"`
}

KafkaDetails is reported by the kafka checker. Partition fields are zero unless a topic is configured.

type ListenDetails added in v0.13.0

type ListenDetails struct {
	// Local addresses of the matching bound sockets, e.g. "0.0.0.0:4739".
	Sockets []string `json:"sockets"`
}

ListenDetails is reported by the listen checker.

type PeerStatus

type PeerStatus struct {
	Name         string `json:"name"`
	Address      string `json:"address"`
	PeerASN      uint32 `json:"peer_asn"`
	SessionState string `json:"session_state"`
	Required     bool   `json:"required"`
	Uptime       string `json:"uptime,omitempty"`
}

PeerStatus is the observable state for one BGP neighbor.

type PingDetails added in v0.12.0

type PingDetails struct {
	// Round-trip time of every echo reply received in this run.
	RTTs []time.Duration `json:"rtts"`
	// Fraction of probes lost, 0..1.
	PacketLoss  float64 `json:"packet_loss"`
	PacketsSent int     `json:"packets_sent"`
	PacketsRecv int     `json:"packets_recv"`
}

PingDetails is reported by the ping checker.

type RouteAttrs added in v0.11.0

type RouteAttrs struct {
	// ASPathPrepend is the number of additional local-ASN hops added to the
	// AS_PATH (on top of the single hop GoBGP adds on eBGP export).
	ASPathPrepend int `json:"as_path_prepend"`
	// Communities are standard BGP communities in "ASN:value" form.
	Communities []string `json:"communities,omitempty"`
}

RouteAttrs are the BGP path attributes pathosd controls on an originated VIP route. The zero value means a plain announcement: no extra AS_PATH prepends and no communities.

type SQLDetails added in v0.13.0

type SQLDetails struct {
	Queries []SQLQueryDetails `json:"queries"`
}

SQLDetails is reported by the sql checker; queries after a failing one are not run and therefore absent.

type SQLQueryDetails added in v0.13.0

type SQLQueryDetails struct {
	Name     string        `json:"name"`
	Rows     int           `json:"rows"`
	Duration time.Duration `json:"duration"`
	Passed   bool          `json:"passed"`
}

SQLQueryDetails is one statement of a SQL check run.

type VIPState

type VIPState int

VIPState represents the effective routing state of a VIP.

const (
	StateWithdrawn  VIPState = 0
	StateAnnounced  VIPState = 1
	StatePessimized VIPState = 2
)

func (VIPState) String

func (s VIPState) String() string

type VIPStatus

type VIPStatus struct {
	Name                 string       `json:"name"`
	Prefix               string       `json:"prefix"`
	State                VIPState     `json:"state"`
	StateName            string       `json:"state_name"`
	Health               HealthStatus `json:"health"`
	HealthName           string       `json:"health_name"`
	ConsecutiveOK        int          `json:"consecutive_ok"`
	ConsecutiveFail      int          `json:"consecutive_fail"`
	LastCheckSuccess     bool         `json:"last_check_success"`
	LastCheckDetail      string       `json:"last_check_detail"`
	LastCheckTime        time.Time    `json:"last_check_time"`
	LastTransitionTime   time.Time    `json:"last_transition_time"`
	LastTransitionReason string       `json:"last_transition_reason"`
	// CheckType is the single check's type, or for a VIP with several
	// checks "all(http, dns)", "any(...)" or the policy expression.
	CheckType string `json:"check_type"`
	// ChecksPolicy is how the checks combine: "all", "any" or an expression.
	ChecksPolicy string `json:"checks_policy"`
	// Checks lists every check of the VIP in config order.
	Checks     []CheckStatus `json:"checks"`
	BGPPending bool          `json:"bgp_pending"`
	// ASPathPrependBase is policy.announce.as_path_prepend: the prepend this
	// node applies to every announcement of the VIP (its standby rank).
	ASPathPrependBase int `json:"as_path_prepend_base"`
	// ASPathPrepend is the prepend currently applied: the base while
	// announced (or withdrawn), base + lower_priority while pessimized.
	ASPathPrepend int `json:"as_path_prepend"`
	// Communities currently attached to the route (announce block, merged
	// with lower_priority while pessimized).
	Communities []string `json:"communities,omitempty"`
}

VIPStatus is the full observable state for one VIP.

Jump to

Keyboard shortcuts

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