mdns

package
v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mdns manages and/or registers new bitbox bases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDeviceInfo

type BaseDeviceInfo struct {
	Hostname string
	IPv4     string
}

BaseDeviceInfo contains the IPv4s and Hostname of a discovered BitBox Base

type Manager

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

Manager listens for new bitboxbases and handles their (de)registration.

func NewManager

func NewManager(
	onDetect func(),
	onRegister func(bitboxbase.Interface) error,
	onUnregister func(string),
	config *config.Config,
	bitboxBaseConfigDir string,
	socksProxy socksproxy.SocksProxy,
) *Manager

NewManager creates a new manager. onRegister is called when a bitboxbase has been inserted. onUnregister is called when the bitboxbase has been removed.

func (*Manager) GetDetectedBases

func (manager *Manager) GetDetectedBases() map[string]string

GetDetectedBases returns bases detected by the manager with the mDNS scan

func (*Manager) RemoveBase

func (manager *Manager) RemoveBase(bitboxBaseID string)

RemoveBase allows external objects to delete a manager entry.

func (*Manager) Start

func (manager *Manager) Start()

Start starts a continuous mDNS scan for BitBox Base devices on local network.

func (*Manager) TryMakeNewBase

func (manager *Manager) 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