util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPToBytes added in v0.1.0

func IPToBytes(ip net.IP) (ret [net.IPv6len]byte)

IPToBytes returns the given IP normalized to a 16 byte array, suitable for use as a map key among other things

func IsIPv6LLMatch

func IsIPv6LLMatch(expected net.IP, actual *net.IPNet, local bool) bool

IsIPv6LLMatch checks if a given expected IPv6 address matches an actual address + mask, checking if the mask is of the expected form. The mask is expected to be /128 if local is false, or /64 if it is true

func NormalizeIP

func NormalizeIP(ip net.IP) net.IP

NormalizeIP returns a version of the given ip normalized to its underlying family, instead of the "always in IPv6 container" format that is often used, so IPv4 values will have a length of 4 and IPv6 ones a length of 16

func TimeMax added in v0.1.2

func TimeMax() time.Time

TimeMax is the maximum representable time in go. see: https://stackoverflow.com/a/32620397/7649 see also `time.go` in the runtime

Types

This section is empty.

Jump to

Keyboard shortcuts

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