network

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfNetworkAvailable

func CheckIfNetworkAvailable() bool

CheckIfNetworkAvailable tests if a pre-set utterly-reliable network setver responds to HTTP GET

func CurrentLinkSpeed added in v1.11.0

func CurrentLinkSpeed() uint64

CurrentLinkSpeed returns the link speed of the selected ext interface or, if no interface selection has been made in the naksu UI, the interface that currently has the lowest link speed. The unit is megabits per second.

Only works for wired network interfaces.

func DownloadFile added in v1.8.0

func DownloadFile(url string, destFile string) error

DownloadFile downloads a file from the given URL and stores it to the given destFile. Returns error

func DownloadString added in v1.8.0

func DownloadString(url string) (string, error)

DownloadString downloads a file and returns it as a string

func GetExtInterfaces added in v1.10.0

func GetExtInterfaces() []constants.AvailableSelection

GetExtInterfaces returns a slice of network interfaces, represented as values of type constants.AvailableSelection where ConfigValue is the system's internal name for the interface (e.g. "eno1") and Legend is a human-readable legend (e.g. "Wireless Network 802.11abc")

Currently the Linux implementation returns interface name and speed as a legend

func IsExtInterface added in v1.10.0

func IsExtInterface(interfaceName string) bool

IsExtInterface returns true if given interfaceName is a name for a valid interface.

func UsingWirelessInterface added in v1.11.0

func UsingWirelessInterface() bool

UsingWirelessInterface returns true if the user has selected a wireless interface in the naksu UI. If the user has made no selection or the selected interface is not wireless, returns false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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