Documentation
¶
Overview ¶
Package discovery publishes the local Warren Host as a DNS-SD service.
Index ¶
Constants ¶
const ( ServiceType = "_warren._tcp" ServiceDomain = "local." TXTVersion = "1" )
Variables ¶
This section is empty.
Functions ¶
func FilterForListener ¶
FilterForListener keeps only addresses that the HTTP listener can actually serve. An unspecified listener accepts every local interface; a loopback or specifically bound listener must not advertise unreachable candidates.
func LocalAddresses ¶
LocalAddresses returns addresses suitable for a LAN advertisement. It excludes loopback, point-to-point, link-local, unspecified, multicast, and interface-down addresses.
Types ¶
type Advertisement ¶
type Advertisement struct {
InstanceName string
HostName string
Port int
IPs []net.IP
TXT []string
}
Advertisement contains the normalized values used to register a Host. Keeping this separate from mdns.MDNSService makes metadata testable without opening a multicast socket.
func BuildAdvertisement ¶
func BuildAdvertisement(config Config) (Advertisement, error)
BuildAdvertisement validates and normalizes a Host advertisement.
type Config ¶
type Config struct {
HostID string
HostName string
DNSHostName string
Protocol string
Build string
Port int
TLS bool
PairingOpen bool
// PairingOpenFunc optionally supplies the live state of the explicit Host
// pairing window. When absent, PairingOpen is used as a static value.
PairingOpenFunc func() bool
Candidates []net.IP
InstanceName string
}
Config describes the public, non-secret part of a Warren Host advertisement. Authentication credentials and private filesystem paths are deliberately absent from this type.