discovery

package
v2.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: GPL-3.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ServiceType = "_zaparoo._tcp"

ServiceType is the DNS-SD service type for Zaparoo Core.

Variables

This section is empty.

Functions

func ResolveInstanceName added in v2.19.0

func ResolveInstanceName(cfg *config.Instance) string

ResolveInstanceName is the name this device presents to discovery clients, over mDNS and Bluetooth alike, and the name a host publishes when it has to advertise the record itself because Core cannot run its own responder there. Priority: config value > hostname > fallback.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manages mDNS service advertising for network discovery. It allows mobile apps to discover Zaparoo Core instances without manual IP configuration.

func New

func New(cfg *config.Instance) *Service

New creates a new discovery service.

func (*Service) InstanceName

func (s *Service) InstanceName() string

InstanceName returns the resolved mDNS instance name. Returns empty string if Start() has not been called.

func (*Service) Start

func (s *Service) Start() error

Start begins mDNS service advertising and keeps it in step with the machine's network interfaces. Registration failing right now is not an error: the watch loop retries for as long as the service runs, because a network that is not ready at boot usually becomes ready shortly after.

func (*Service) Stop

func (s *Service) Stop()

Stop gracefully shuts down mDNS advertising, sending goodbye packets.

Directories

Path Synopsis
Package mdns advertises a single DNS-SD service over multicast DNS.
Package mdns advertises a single DNS-SD service over multicast DNS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL