network

package
v0.0.0-...-a534134 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: GPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const Identifier = "network"

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicNetworkDevice

type BasicNetworkDevice struct {
	// A friendly name to be used on the bar
	Name string

	// Name of the network interface for the corresponding device
	Identifier string
	// contains filtered or unexported fields
}

A BaseBasicNetworkDevice describes a network device to be displayed on an i3bar TODO: Usage speed?

func (*BasicNetworkDevice) Connected

func (d *BasicNetworkDevice) Connected() bool

func (*BasicNetworkDevice) FriendlyName

func (d *BasicNetworkDevice) FriendlyName() string

func (*BasicNetworkDevice) Generate

func (d *BasicNetworkDevice) Generate() ([]i3.Output, error)

Generate implements i3.Generator

func (*BasicNetworkDevice) IP

func (d *BasicNetworkDevice) IP() net.IP

func (*BasicNetworkDevice) Interface

func (d *BasicNetworkDevice) Interface() string

func (*BasicNetworkDevice) Speed

func (d *BasicNetworkDevice) Speed() uint64

func (*BasicNetworkDevice) Update

func (d *BasicNetworkDevice) Update() error

Update implements NetworkDevice

type Devicer

type Devicer interface {
	Device() (i3.Generator, error)
}

Devicer is an interface used within this package to represent a configuration struct that is able to produce a Generator (representing one or more network devices)

type MultiDevice

type MultiDevice struct {
	Devices map[string]NetworkDevice

	// Oredered list of keys describing preferred networks to show
	Preference []string
}

MultiDevice is a Generator that manages a set of networks, and shows the most preferred network that is conneced

func (MultiDevice) Generate

func (m MultiDevice) Generate() ([]i3.Output, error)

type NetworkDevice

type NetworkDevice interface {
	i3.Generator

	FriendlyName() string
	Interface() string
	IP() net.IP
	Speed() uint64
	Connected() bool

	Update() error
}

type WLANDevice

type WLANDevice struct {
	BasicNetworkDevice

	WarnThreshold int
	CritThreshold int
	// contains filtered or unexported fields
}

func (*WLANDevice) Generate

func (d *WLANDevice) Generate() ([]i3.Output, error)

Generate implements Generator

Jump to

Keyboard shortcuts

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