network

package
Version: v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	Name   string `json:"name"`
	MAC    string `json:"mac"`
	Speed  int    `json:"speed"`
	MTU    int    `json:"mtu"`
	Driver string `json:"driver"`
	Path   string `json:"path"`
}

Adapter captures a physical adapter.

type Bridge

type Bridge struct {
	Name string `json:"name"`
	MAC  string `json:"mac"`
	MTU  int    `json:"mtu"`
	Path string `json:"path"`
}

Bridge captures bridge devices.

type Probe

type Probe struct {
	Physical []Adapter `json:"physical"`
	Bridges  []Bridge  `json:"bridges"`
	Virtual  []Virtual `json:"virtual"`
	// contains filtered or unexported fields
}

Probe struct for storage. Splits adapters by physical adapters, virtual adapters, and bridges.

func New

func New() (*Probe, error)

New initializes new probe struct and probes the system.

func (*Probe) Driver

func (p *Probe) Driver(target string) string

Driver returns the device driver.

func (*Probe) JSON

func (p *Probe) JSON() string

JSON representation of the struct.

func (*Probe) MAC

func (p *Probe) MAC(target string) string

MAC returns the physical MAC address.

func (*Probe) MTU

func (p *Probe) MTU(target string) int

MTU returns the device MTU.

func (*Probe) Speed

func (p *Probe) Speed(target string) int

Speed returns the speed of the adapter.

func (*Probe) String

func (p *Probe) String() string

String representation of the struct.

type Virtual

type Virtual struct {
	Name string `json:"name"`
	MAC  string `json:"mac"`
	MTU  int    `json:"mtu"`
	Path string `json:"path"`
}

Virtual captures non-bridge devices that are virtual.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL