net

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package net contains utilities for manipulating network.

Index

Constants

View Source
const (
	// LocalAddress is the local address.
	LocalAddress = "127.0.0.1"

	// PublicAddress is the public address.
	PublicAddress = "0.0.0.0"
)

Variables

This section is empty.

Functions

func AddCIDR added in v0.4.0

func AddCIDR(cidr string, index int) (string, error)

AddCIDR adds the CIDR.

func AddIP added in v0.4.0

func AddIP(ip net.IP, add uint64) net.IP

AddIP adds or subtracts the IP.

func GetAllIPs added in v0.3.0

func GetAllIPs() ([]string, error)

GetAllIPs returns all IPs of the host.

func GetUnusedPort

func GetUnusedPort(ctx context.Context, used sets.Sets[uint32]) (uint32, error)

GetUnusedPort returns an unused port on the local machine.

func ParseCIDR added in v0.4.0

func ParseCIDR(s string) (*net.IPNet, error)

ParseCIDR parses a CIDR string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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