addrmon

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package addrmon contains the address monitor.

Index

Constants

This section is empty.

Variables

View Source
var RegisterAddrUpdates = func(a *AddrMon) (chan netlink.AddrUpdate, error) {

	events := make(chan netlink.AddrUpdate)
	options := netlink.AddrSubscribeOptions{
		ListExisting: true,
	}
	if err := netlinkAddrSubscribeWithOptions(events, a.upsDone, options); err != nil {
		return nil, fmt.Errorf("could not subscribe to address events: %w", err)
	}

	return events, nil
}

RegisterAddrUpdates registers for addr update events.

Functions

This section is empty.

Types

type AddrMon

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

AddrMon is an address monitor.

func NewAddrMon

func NewAddrMon() *AddrMon

NewAddrMon returns a new address monitor.

func (*AddrMon) Start

func (a *AddrMon) Start() error

Start starts the address monitor.

func (*AddrMon) Stop

func (a *AddrMon) Stop()

Stop stops the address monitor.

func (*AddrMon) Updates

func (a *AddrMon) Updates() chan *Update

Updates returns the address updates channel.

type Update

type Update struct {
	Add     bool
	Address net.IPNet
	Index   int
}

Update is an address update.

Jump to

Keyboard shortcuts

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