monitor

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package monitor provides facilities for monitoring network interface and route changes. It primarily exists to know when portable devices move between different networks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeFunc

type ChangeFunc func()

ChangeFunc is a callback function that's called when an interface status changes.

type Mon

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

Mon represents a monitoring instance.

func New

func New(logf logger.Logf, callback ChangeFunc) (*Mon, error)

New instantiates and starts a monitoring instance. Change notifications are propagated to the callback function. The returned monitor is inactive until it's started by the Start method.

func (*Mon) Close

func (m *Mon) Close() error

Close closes the monitor. It may only be called once.

func (*Mon) Start

func (m *Mon) Start()

Start starts the monitor. A monitor can only be started & closed once.

Jump to

Keyboard shortcuts

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