Documentation ¶
Overview ¶
ctl package contains the core business logic of the `heartbeatctl` application. It exposes a Port (interface) that provides methods for controlling Heartbeats, listing them, enabling, disabling, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSelector = errors.New(
"No selector options given, to target all heartbeats pass '.*' name expression explicitly.",
)
ErrNoSelector is an error returned when a particular method requires a non-empty selector but none was given.
Functions ¶
This section is empty.
Types ¶
type Port ¶
type Port interface { // Get returns a list of Heartbeats. If SelectorConfig is given, the list // is filtered down to only include Heartbeats matching both the label and // field selectors or name expressions (all of which are optional), // otherwise all Heartbeats are returned. Get(*SelectorConfig) ([]heartbeat.Heartbeat, error) // Enable enables all heartbeats selected by given SelectorConfig, which // in this case must specify at least one selector or name (to target all // heartbeats specify a `nameExpressions=['.*']` rule explicitly). Enable(*SelectorConfig) ([]heartbeat.HeartbeatInfo, error) // Disable disables all heartbeats selected by given SelectorConfig, which // in this case must specify at least one selector or name (to target all // heartbeats specify a `nameExpressions=['.*']` rule explicitly). Disable(*SelectorConfig) ([]heartbeat.HeartbeatInfo, error) // Ping pings all heartbeats selected by given SelectorConfig, which // in this case must specify at least one selector or name (to target all // heartbeats specify a `nameExpressions=['.*']` rule explicitly). Ping(*SelectorConfig) (map[string]heartbeat.PingResult, error) }
Port of the heartbeatctl application
type SelectorConfig ¶
type SelectorConfig struct { // NameExpressions specifies a list of regular expressions to match against // names of heartbeats. Note that unlike label and field selectors // heartbeats matching any of the names are returned, but if both name // expressions and any selectors are specified at the same time, the // heartbeat must match all to be returned. NameExpressions []string // LabelSelector specifies a selector to filter the list of returned // objects using a K8s-compatible label selector syntax. // Defaults to accepting everything. LabelSelector string // FieldSelector specifies a selector to filter the list of returned // objects using a K8s-compatible field selector syntax. // Defaults to accepting everything. FieldSelector string }
SelectorConfig allow configuring selectors that specify field or label query expressions to filter a list of objects to operate on.
Click to show internal directories.
Click to hide internal directories.