netx

package module
v0.0.0-...-3d4b4d2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: BSD-3-Clause Imports: 7 Imported by: 3

README

netx-go

Go Reference Test

Useful utilities from Go's net package, exported for convenience.

go get github.com/database64128/netx-go

License

BSD 3-Clause

Documentation

Overview

Package netx provides exported versions of some unexported utilities in the net package.

Index

Constants

This section is empty.

Variables

View Source
var IPStackCaps = sync.OnceValue(probe)

IPStackCaps returns the IP stack capabilities of the system.

View Source
var ZoneCache = IPv6ZoneCache{
	// contains filtered or unexported fields
}

ZoneCache is the global shared cache for IPv6 addressing scope zone resolution.

Functions

This section is empty.

Types

type IPStackCapabilities

type IPStackCapabilities struct {
	IPv4Enabled           bool
	IPv6Enabled           bool
	IPv4MappedIPv6Enabled bool
}

IPStackCapabilities represents IPv4, IPv6 and IPv4-mapped IPv6 communication capabilities which are controlled by the IPV6_V6ONLY socket option and kernel configuration.

type IPv6ZoneCache

type IPv6ZoneCache struct {
	sync.RWMutex // guard the following
	// contains filtered or unexported fields
}

IPv6ZoneCache represents a cache holding partial network interface information. It is used for reducing the cost of IPv6 addressing scope zone resolution.

Multiple names sharing the index are managed by first-come first-served basis for consistency.

func (*IPv6ZoneCache) Index

func (zc *IPv6ZoneCache) Index(name string) int

Index returns the Index of the network interface with the given name.

func (*IPv6ZoneCache) Name

func (zc *IPv6ZoneCache) Name(index int) string

Name returns the name of the network interface with the given index.

func (*IPv6ZoneCache) Update

func (zc *IPv6ZoneCache) Update(ift []net.Interface, force bool) (updated bool)

Update refreshes the network interface information if the cache was last updated more than 1 minute ago, or if force is set. It reports whether the cache was updated.

Jump to

Keyboard shortcuts

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