netutil

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package netutil provides utility functions for network operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPortOpen added in v0.5.0

func IsPortOpen(port int) bool

IsPortOpen checks if the TCP port is open/used. It returns true if the port is open/used, otherwise false.

func PublicIP

func PublicIP() (string, error)

Types

type InterfaceAddr added in v0.5.0

type InterfaceAddr struct {
	Iface net.Interface
	Addr  netip.Addr
}

InterfaceAddr represents a network interface and its associated InterfaceAddr address.

type InterfaceAddrs added in v0.5.0

type InterfaceAddrs []InterfaceAddr

InterfaceAddrs is a slice of InterfaceAddr.

func GetPrivateIPs added in v0.5.0

func GetPrivateIPs(opts ...OpOption) (InterfaceAddrs, error)

GetPrivateIPs finds private IP addresses using an optional interface filter. It returns a slice of IP structs, each containing interface and address information.

func (InterfaceAddrs) RenderTable added in v0.5.0

func (addrs InterfaceAddrs) RenderTable(wr io.Writer)

RenderTable renders the InterfaceAddrs as a table.

type Op added in v0.5.0

type Op struct {
	// contains filtered or unexported fields
}

type OpOption added in v0.5.0

type OpOption func(*Op)

func WithPrefixesToSkip added in v0.5.0

func WithPrefixesToSkip(prefixes ...string) OpOption

func WithSuffixesToSkip added in v0.5.0

func WithSuffixesToSkip(suffixes ...string) OpOption

Directories

Path Synopsis
Package latency contains logic for egress traffic from each device.
Package latency contains logic for egress traffic from each device.
edge
Package edge provides a client for the Tailscale DERP (Designated Edge Router Protocol) service.
Package edge provides a client for the Tailscale DERP (Designated Edge Router Protocol) service.
edge/derpmap
Package derpmap provides the tailscale derp map implementation.
Package derpmap provides the tailscale derp map implementation.
edge/derpmap/sync command
"sync" syncs the tailscale derp map.
"sync" syncs the tailscale derp map.

Jump to

Keyboard shortcuts

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