Documentation ¶
Overview ¶
Package hubnet with functions to get the outbound network interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBearerToken ¶
GetBearerToken returns the bearer token from the HTTP request authorization header Returns an error if no token present or token isn't a bearer token
func GetInterfaces ¶
GetInterfaces returns a list of active network interfaces excluding the loopback interface
address to only return the interface that serves the given IP address
func GetOutboundIP ¶
GetOutboundIP returns the default outbound IP address to reach the given hostname. This uses 1.1.1.1 as the default destination. TODO: use the default gateway address instead so this works without internet access.
Use a local hostname if a subnet other than the default one should be used. Use "" for the default route address
destination to reach or "" to use 1.1.1.1 (no connection will be established)
func GetOutboundInterface ¶
GetOutboundInterface Get preferred outbound network interface of this machine Credits: https://stackoverflow.com/questions/23558425/how-do-i-get-the-local-ip-address-in-go and https://qiita.com/shaching/items/4c2ee8fd2914cce8687c
Types ¶
This section is empty.