network_helpers

package
v1.67.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	IPV6_MARKER = ":"
)

Variables

This section is empty.

Functions

func GopsutilInterfacesProvider

func GopsutilInterfacesProvider() ([]net.InterfaceStat, error)

func IPAddressesByType

func IPAddressesByType(addrs []net.InterfaceAddr) (ipv4, ipv6 string)

Returns the IPv4 & IPv6 addresses from the list of InterfaceAddr. If multiple addresses of the same type exist, the last seen takes precedence.

func IsAddressIPv6

func IsAddressIPv6(s string) bool

Returns if the provided string represents a valid IPv6 address.

func ShouldIgnoreInterface

func ShouldIgnoreInterface(filters map[string][]string, name string) bool

Returns true if we should completely ignore the given interface.

func TCPPort

func TCPPort() (int, error)

TCPPort returns a random free TCP port.

Types

type InterfacesProvider

type InterfacesProvider func() ([]net.InterfaceStat, error)

Jump to

Keyboard shortcuts

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