Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ServiceName is the mDNS service name (e.g., "dirio-s3")
ServiceName string
// Port is the S3 data-plane HTTP port number
Port int
// AdminPort is the admin/console control-plane port (dual-port mode).
// When non-zero and different from Port, additional mDNS service records
// are registered for the admin control plane on this port.
AdminPort int
// HTTPSPort is the HTTPS port (optional)
HTTPSPort int
// TXTRecords are additional TXT records for service discovery
TXTRecords map[string]string
}
Config holds configuration for mDNS service registration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents an mDNS service registration for DirIO.
The service uses a unique hostname format: <service-name>-<unique-id>.local This prevents conflicts with system mDNS responders (Bonjour/Avahi) and allows us to safely run our own mDNS responder on all platforms.
func (*Service) GetAdvertisedHost ¶
GetAdvertisedHost returns the hostname being advertised via mDNS. Format: <service-name>-<unique-id>.local (e.g., "dirio-s3-abc123.local")
func (*Service) Start ¶
Start begins advertising the mDNS service on the local network.
The service uses a unique hostname format: <service-name>-<unique-id>.local (e.g., "dirio-s3-abc123.local") which prevents conflicts with system mDNS responders.
Service discovery records (_http._tcp, _s3._tcp) point to this unique hostname, allowing clients to discover and connect to the service.
ctx controls the lifetime of the service: if the context is cancelled before Stop is called the responder loop exits, though Stop should still be called explicitly to send mDNS goodbye packets before the process exits.