environment

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN uint8 = iota
	OFFLINE
	LIMITED // local network only
	PORTAL  // there seems to be an internet connection, but we are being intercepted
	ONLINE
)

Variables

This section is empty.

Functions

func ConnectionSucceeded

func ConnectionSucceeded()

ConnectionSucceeded should be called when a module was able to successfully connect to the internet (do not call too often)

func Connectivity

func Connectivity() uint8

Connectivity returns the current state of connectivity to the network/Internet

func Gateways

func Gateways() []*net.IP

Gateways returns the currently active gateways

func GetApproximateInternetLocation

func GetApproximateInternetLocation() (net.IP, error)

GetApproximateInternetLocation returns the IP-address of the nearest ping-answering internet node

func GetAssignedAddresses

func GetAssignedAddresses() (ipv4 []net.IP, ipv6 []net.IP, err error)

func GetAssignedGlobalAddresses

func GetAssignedGlobalAddresses() (ipv4 []net.IP, ipv6 []net.IP, err error)

func NetworkChanged

func NetworkChanged() <-chan struct{}

Types

type EnvironmentInterface

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

func NewInterface

func NewInterface() *EnvironmentInterface

func (*EnvironmentInterface) NetworkChanged

func (env *EnvironmentInterface) NetworkChanged() bool

type Nameserver

type Nameserver struct {
	IP     net.IP
	Search []string
}

func Nameservers

func Nameservers() []Nameserver

Nameservers returns the currently active nameservers

Jump to

Keyboard shortcuts

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