Documentation
¶
Index ¶
- Variables
- func Check(err error) bool
- func Debug(a ...interface{})
- func Debugc(fn func() string)
- func Debugf(format string, a ...interface{})
- func Debugs(a interface{})
- func Discover() (err error)
- func Error(a ...interface{})
- func Errorc(fn func() string)
- func Errorf(format string, a ...interface{})
- func Errors(a interface{})
- func Fatal(a ...interface{})
- func Fatalc(fn func() string)
- func Fatalf(format string, a ...interface{})
- func Fatals(a interface{})
- func GetAddressesAndInterfaces() (Interfaces []*net.Interface, Addresses map[string]struct{})
- func GetAllInterfacesAndAddresses() (interfaces []*net.Interface, udpAddrs []*net.UDPAddr)
- func GetInterface() (ifc *net.Interface, address string, err error)
- func GetListenable() net.IP
- func Info(a ...interface{})
- func Infoc(fn func() string)
- func Infof(format string, a ...interface{})
- func Infos(a interface{})
- func Trace(a ...interface{})
- func Tracec(fn func() string)
- func Tracef(format string, a ...interface{})
- func Traces(a interface{})
- func Warn(a ...interface{})
- func Warnc(fn func() string)
- func Warnf(format string, a ...interface{})
- func Warns(a interface{})
Constants ¶
This section is empty.
Variables ¶
var Address net.IP
Address is the network address that routes to the gateway and thus the internet
var Gateway net.IP
Gateway stores the current network default gateway as discovered by github.com/jackpal/gateway
var Interface *net.Interface
Interface is the net.Interface of the Address above
var SecondaryAddresses []net.IP
SecondaryAddresses are all the other addresses that can be reached from somewhere (including localhost) but not necessarily the internet
var SecondaryInterfaces []*net.Interface
SecondaryInterfaces is the interfaces of the SecondaryAddresses stored in the corresponding slice index
Functions ¶
func Discover ¶ added in v1.9.16
func Discover() (err error)
Discover enumerates and evaluates all known network interfaces and addresses and filters it down to the ones that reach both a LAN and the internet
We are only interested in IPv4 addresses because for the most part, domestic ISPs do not issue their customers with IPv6 routing, it's still a pain in the ass outside of large data centre connections
func GetAddressesAndInterfaces ¶ added in v1.9.16
GetAddressesAndInterfaces returns all of the addresses and interfaces that would be resolved from an automatic addresses that can connect two processes at all
func GetAllInterfacesAndAddresses ¶ added in v1.9.16
func GetInterface ¶
GetInterface returns the address and interface of multicast-and-internet capable interfaces
func GetListenable ¶ added in v1.9.16
Types ¶
This section is empty.