discovery

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package discovery announces the SpeechKit server on the local network via mDNS/DNS-SD so LAN devices (Kombify Box, desktop app, Android) can find a homelab instance under `_speechkit._tcp` without typing an address.

Scope: announcement only, opt-in via [server.discovery] (default OFF). The TXT record carries the dial URL plus enabled modes; it never carries credentials — auth (bearer/OIDC) applies unchanged after discovery.

Index

Constants

View Source
const ServiceType = "_speechkit._tcp"

ServiceType is the DNS-SD service type SpeechKit servers announce.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcer

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

Announcer wraps the running mDNS responder.

func Start

func Start(cfg *config.Config, version string, modes []string) (*Announcer, error)

Start begins announcing when cfg.Server.Discovery.Enabled is set; it returns (nil, nil) when discovery is off. version and modes land in the TXT record so clients can filter capable instances (the Box needs "voiceagent").

func (*Announcer) Shutdown

func (a *Announcer) Shutdown()

Shutdown stops the responder (safe on nil).

type Record

type Record struct {
	InstanceName string   `json:"instanceName"`
	URL          string   `json:"url"`
	Modes        []string `json:"modes,omitempty"`
	Version      string   `json:"version,omitempty"`
}

Record is one SpeechKit server found on the LAN. URL is the only dial address; credentials never belong here.

func Browse

func Browse(ctx context.Context) []Record

Browse looks up `_speechkit._tcp` on the LAN. It never returns credentials. An empty result is not an error: nothing announced, or discovery is off on the server.

func ParseTXT

func ParseTXT(instanceName string, lines []string) (Record, bool)

ParseTXT reads `key=value` TXT lines as the announcer emits them. Missing url is not a dialable server.

Jump to

Keyboard shortcuts

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