netinfo

package
v0.0.0-...-c936f35 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 21

Documentation

Overview

Package netinfo provides an i3bar module for network information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module represents a netinfo bar module.

func Interface

func Interface(iface string) *Module

Interface constructs an instance of the netinfo module restricted to the specified interface.

func New

func New() *Module

New constructs a netinfo module that scans all interfaces.

func Prefix

func Prefix(prefix string) *Module

Prefix constructs an instance of the netinfo module restricted to interfaces with the given prefix.

func (*Module) Output

func (m *Module) Output(outputFunc func(State) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

type State

type State struct {
	netlink.Link
}

State represents the network state.

func (State) Connected

func (s State) Connected() bool

Connected returns true if connected to a network.

func (State) Connecting

func (s State) Connecting() bool

Connecting returns true if a connection is in progress.

func (State) Enabled

func (s State) Enabled() bool

Enabled returns true if a network interface is enabled.

func (State) Gone

func (s State) Gone() bool

Gone returns true if a network interface just disappeared..

func (State) Unknown

func (s State) Unknown() bool

Unknown returns true if a network interface is in Unknown state.

Jump to

Keyboard shortcuts

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