network

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package network provides network-related utilities for LocalGo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAddress

func FormatAddress(ip net.IP, port int, https bool) string

FormatAddress formats an IP address and port into a URL

func GetInterfaceIPs

func GetInterfaceIPs(interfaceName string) ([]string, error)

GetInterfaceIPs returns all IP addresses for a specific network interface

func GetLocalIP

func GetLocalIP() (string, error)

GetLocalIP returns the primary non-loopback IP address of the machine

func GetLocalIPAddresses

func GetLocalIPAddresses() ([]net.IP, error)

GetLocalIPAddresses returns a list of local IP addresses for all non-loopback interfaces

func GetPreferredOutboundIP

func GetPreferredOutboundIP() (net.IP, error)

GetPreferredOutboundIP gets the preferred IP address for outbound connections

func GetSubnetIPs added in v0.1.1

func GetSubnetIPs(ip net.IP) []net.IP

GetSubnetIPs returns all IP addresses in the same /24 subnet as the given IP

func ParseCIDRRange added in v0.5.5

func ParseCIDRRange(cidr string) ([]net.IP, error)

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).

Types

This section is empty.

Jump to

Keyboard shortcuts

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