Documentation
¶
Overview ¶
Package mdns wraps github.com/hashicorp/mdns to advertise and discover Omaclip instances on the local network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoDiscoverableIPs = fmt.Errorf("mdns: no discoverable IPs, skipping registering to the network")
Functions ¶
This section is empty.
Types ¶
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
Discoverer registers this instance via mDNS and continuously browses for peers.
func New ¶
func New(log *slog.Logger, browsePeriod time.Duration, hostname string, ps *passphrase.Store) *Discoverer
New creates a Discoverer. Call Register then Start to begin advertising and browsing.
func (*Discoverer) Peers ¶
func (d *Discoverer) Peers() []Peer
Peers returns a snapshot of currently known peers.
func (*Discoverer) Register ¶
func (d *Discoverer) Register(port int) error
Register advertises this Omaclip instance at the given port via mDNS.
func (*Discoverer) Start ¶
func (d *Discoverer) Start(ctx context.Context)
Start begins the periodic browse loop until ctx is cancelled.
Click to show internal directories.
Click to hide internal directories.