Documentation
¶
Overview ¶
Package network provides network-related utilities for LocalGo
Index ¶
- func DefaultGatewayIP() (net.IP, error)
- func FormatAddress(ip net.IP, port int, https bool) string
- func GetInterfaceIPs(interfaceName string) ([]string, error)
- func GetLocalIP() (string, error)
- func GetLocalIPAddresses() ([]net.IP, error)
- func GetPreferredOutboundIP() (net.IP, error)
- func GetSubnetIPs(ip net.IP) []net.IP
- func ParseCIDRRange(cidr string) ([]net.IP, error)
- func PrimaryLANIP() (net.IP, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGatewayIP ¶ added in v0.6.0
DefaultGatewayIP returns the IP address of the default network gateway.
func FormatAddress ¶
FormatAddress formats an IP address and port into a URL
func GetInterfaceIPs ¶
GetInterfaceIPs returns all IP addresses for a specific network interface
func GetLocalIP ¶
GetLocalIP returns the primary non-loopback IP address of the machine
func GetLocalIPAddresses ¶
GetLocalIPAddresses returns a list of local IP addresses for all non-loopback interfaces
func GetPreferredOutboundIP ¶
GetPreferredOutboundIP gets the preferred IP address for outbound connections
func GetSubnetIPs ¶ added in v0.1.1
GetSubnetIPs returns all IP addresses in the same /24 subnet as the given IP
func ParseCIDRRange ¶ added in v0.5.5
ParseCIDRRange parses a CIDR notation (e.g. "192.168.1.0/24") and returns all usable host IPs in that range (network and broadcast addresses excluded).
func PrimaryLANIP ¶ added in v0.6.0
PrimaryLANIP returns the local IP address on the interface that owns the default gateway. This is useful for prioritizing the real LAN subnet when scanning, rather than scanning Docker/VPN subnets.
Types ¶
This section is empty.