monitor

package
v0.96.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package monitor provides facilities for monitoring network interface changes.

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