Documentation
¶
Overview ¶
Package mdns wraps github.com/grandcat/zeroconf to advertise and discover Omaclip instances on the local network.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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, ifaceName string, ) (*Discoverer, error)
New creates a Discoverer. Call Register then Start to begin advertising and browsing. If ifaceName is non-empty, mDNS will bind to that network interface only.
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.