Documentation
¶
Overview ¶
Package discovery detects HTTP services running on the edge host next to the agent (e.g. Home Assistant). The edges provider pulls the result over the tunnel via the agent's /api/v1/services endpoint and materializes an EdgeService per discovered service. Detectors must never fail the endpoint: every probe/exec error is treated as "not detected".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detector ¶
type Detector interface {
// Name is the detector id, used for logging.
Name() string
// Detect returns the discovered service and true when found. It must not
// return partial results with false, and must never block longer than a
// few seconds.
Detect(ctx context.Context) (*DiscoveredService, bool)
}
Detector probes for one kind of service.
func DefaultDetectors ¶
func DefaultDetectors() []Detector
DefaultDetectors is the built-in detector set. Home Assistant is the first; add more here as new integrations land.
type DiscoveredService ¶
type DiscoveredService struct {
// Name is a human-readable service name (e.g. "home-assistant").
Name string `json:"name"`
// Type is the detector id; it matches an EdgeServiceType value.
Type string `json:"type"`
// Scheme is "http" or "https".
Scheme string `json:"scheme"`
// Port is the loopback port the service listens on.
Port int32 `json:"port"`
// Version is best-effort (e.g. a container image tag).
Version string `json:"version,omitempty"`
// InstallType is how the service is installed: container|core|haos|supervised.
InstallType string `json:"installType,omitempty"`
}
DiscoveredService is one service the agent found on the host. JSON tags match the wire format the provider's discovery reconciler decodes.