network

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNetworkExists       = errors.New("network exists")
	ErrNetworkDoesNotExist = errors.New("network does not exists")
)

Functions

func IsUsefulInterface

func IsUsefulInterface(iface net.Interface) bool

func NewNetworkIterator

func NewNetworkIterator(n Network) *networkIterator

func NewNetworkIteratorAsChannel

func NewNetworkIteratorAsChannel(n Network) *networkIteratorAsChannel

func SortNetworksByAddr

func SortNetworksByAddr(nets []Network)

Types

type DiscoveredNetwork

type DiscoveredNetwork Network

type Network

type Network struct {
	Name     string
	Prefix   netip.Prefix
	LastScan time.Time
	Tags     []tags.Tag
}

func New

func New(name string, ns string) (Network, error)

func NewNetworkFromPrefix

func NewNetworkFromPrefix(ns netip.Prefix) Network

func (Network) Contains

func (n Network) Contains(d device.Device) bool

func (Network) String

func (n Network) String() string

type NetworkAddedEvent

type NetworkAddedEvent Network

NetworkAddEvent

type NetworkFilter

type NetworkFilter func(Network) bool

NetworkFilter defines a function used to select a set of required devices.

type NetworkStats

type NetworkStats struct {
	Network
	IPUsed  uint64
	IPTotal float64
	AvgPing time.Duration
	MaxPing time.Duration
}

type ScanAllNetworksRequest

type ScanAllNetworksRequest struct{}

type ScanNetworkRequest

type ScanNetworkRequest Network

Jump to

Keyboard shortcuts

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