mdns

package
v4.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mdns manages detects and/or registers new bitbox bases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector listens for new bitboxbases and creates a new bitboxBase when detected.

func NewDetector

func NewDetector(
	onRegister func(bitboxbase.Interface) error,
	onUnregister func(string),
	config *config.Config,
) *Detector

NewDetector creates a new detector. onRegister is called when a bitboxbase has been inserted. onUnregister is called when the bitboxbase has been removed.

func (*Detector) RemoveBase

func (detector *Detector) RemoveBase(bitboxBaseID string)

RemoveBase allows external objects to delete a detector entry.

func (*Detector) Start

func (detector *Detector) Start()

Start listens for inserted/removed base devices forever.

func (*Detector) TryMakeNewBase

func (detector *Detector) TryMakeNewBase(address string) (bool, error)

TryMakeNewBase attempts to create a new bitboxBase connection to the BitBox base. Returns true if successful, false otherwise.

Jump to

Keyboard shortcuts

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