ds

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: BSD-3-Clause Imports: 14 Imported by: 2 modules, 1 package

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 (
	// Default is the default query.
	Default = "dnssd://?sort=tenants&sort=cpu.pcnt"
	// Timeout is the default query timeout.
	Timeout = 1 * time.Second // query-timeout

)

Variables

This section is empty.

Functions

func DefaultInstance

func DefaultInstance() string

func DefaultTxt

func DefaultTxt(txtFlag map[string]string)

func ParseKv

func ParseKv(arg string) map[string]string

Parse DNS-SD key value string into Map w/sensible default for empty keys

func Register

func Register(instanceFlag, domainFlag, serviceFlag, interfaceFlag string, portFlag int, txtFlag map[string]string) error

func Tenant

func Tenant(delta int)

update tenant count by delta

func Unregister

func Unregister()

func UpdateSysInfo

func UpdateSysInfo(txtFlag map[string]string)

func Verbose

func Verbose(f func(string, ...interface{}))

setup Verbose

Types

type LookupResult

type LookupResult struct {
	Entry dnssd.BrowseEntry
	Error error
}

LookupResult holds a dnssd.BrowseEntry struct and an error. TOOD: it should implement the error interface

func Lookup

func Lookup(query Query, n int) ([]*LookupResult, error)

lookup based on query, return resolved host, port, network, and error uri currently supported dnssd://instance._service._network.domain/?reqkey=reqvalue default for domain is local, default type _ncpu._tcp, and instance is wildcard can omit to underspecify, e.g. dnssd:?arch=arm64 to pick any arm64 cpu server

type Query

type Query struct {
	Type     string
	Instance string
	Domain   string
	Text     map[string][]string
}

Simple form dns-sd query

func Parse

func Parse(uri string) (Query, error)

parse DNS-SD URI to dnssd struct we could subtype BrowseEntry or Service, but why?

Jump to

Keyboard shortcuts

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