discovery

package
v0.0.0-...-a67a4a9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package discovery to facilitate discovery of Hub services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInterfaces

func GetInterfaces(address string) ([]net.Interface, error)

Get a list of active network interfaces excluding the loopback interface

address to only return the interface that serves the given IP address

func ServeDiscovery

func ServeDiscovery(instanceID string, serviceName string,
	address string, port uint, params map[string]string) (*zeroconf.Server, error)

ServeDiscovery publishes a WoST service for discovery. See also 'DiscoverService' for discovery of this published service.

WoST services use this to announce the service instance and how they can be reached on the local domain.

Instance = instance name of the service. Used to differentiate between services with the same name (type)
ServiceName = name of the provided service, for example, ipp, idprov, wotdir

This is a wrapper around one or more discovery methods. Internally this uses DNS-SD but can be expanded with additional protocols in the future.

DNS-SD will publish this as _<instance>._<serviceName>._tcp

instanceID is the unique ID of the service instance, usually the plugin-ID
serviceName is the discover name. For example "idprov"
address service listening IP address
port service listing port
params is a map of key-value pairs to include in discovery, for example {path:/idprov/}

Returns the discovery service instance. Use Shutdown() when done.

Types

This section is empty.

Jump to

Keyboard shortcuts

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