Documentation ¶
Index ¶
- func CheckIfNetworkAvailable() bool
- func CurrentLinkSpeed() uint64
- func DownloadFile(url string, destFile string) error
- func DownloadString(url string) (string, error)
- func GetExtInterfaces() []constants.AvailableSelection
- func IsExtInterface(interfaceName string) bool
- func UsingWirelessInterface() bool
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
DownloadFile downloads a file from the given URL and stores it to the given destFile. Returns error
func DownloadString ¶ added in v1.8.0
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
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.