netchange

package
v0.0.0-...-846a3b6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

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 - object is detecting routing changes on a PC. To avoid multiple notifications of multiple changes - the 'DelayBeforeNotify' is in use (notification will occur after 'DelayBeforeNotify' elapsed since last detected change)

func Create

func Create() *Detector

Create - create new network change detector 'routingChangeChan' is a notification channel

func (*Detector) DelayBeforeNotify

func (d *Detector) DelayBeforeNotify() time.Duration

DelayBeforeNotify - To avoid multiple notifications of multiple changes - the 'DelayBeforeNotify' is in use (notification will occur after 'DelayBeforeNotify' elapsed since last detected change)

func (*Detector) Start

func (d *Detector) Start(routingChangeChan chan<- struct{}, routingUpdateChan chan<- struct{}, currentDefaultInterface *net.Interface)

Start - start route change detector (asynchronous)

'routingChangeChan' is the channel for notifying when the default routing is NOT over the 'interfaceToProtect' anymore
'routingUpdateChan' is the channel for notifying when there were some routing changes but 'interfaceToProtect' is still is the default route

func (*Detector) Stop

func (d *Detector) Stop()

Stop - stop route change detector

Jump to

Keyboard shortcuts

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