Documentation
¶
Overview ¶
Package interfaces contains helpers for looking up system network interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForeachInterfaceAddress ¶
ForeachInterfaceAddress calls fn for each interface's address on the machine.
func HaveIPv6GlobalAddress ¶
HaveIPv6GlobalAddress reports whether the machine appears to have a global scope unicast IPv6 address.
It only returns an error if there's a problem querying the system interfaces.
func IsTailscaleIP ¶
IsTailscaleIP reports whether ip is an IP in a range used by Tailscale virtual network interfaces.
func LocalAddresses ¶
LocalAddresses returns the machine's IP addresses, separated by whether they're loopback addresses.
Types ¶
type Interface ¶
Interface is a wrapper around Go's net.Interface with some extra methods.
func (Interface) IsLoopback ¶
type State ¶
State is intended to store the state of the machine's network interfaces, routing table, and other network configuration. For now it's pretty basic.
func (*State) RemoveTailscaleInterfaces ¶
func (s *State) RemoveTailscaleInterfaces()
RemoveTailscaleInterfaces modifes s to remove any interfaces that are owned by this process. (TODO: make this true; currently it makes the Linux-only assumption that the interface is named /^tailscale/)