util

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildURL added in v1.10.0

func BuildURL(parts ...string) (string, error)

BuildURL constructs a URL from parts. It handles any irregularities like missing or extra slashes.

func PublicIP

func PublicIP(ipversion uint) (net.IP, error)

PublicIP returns the external/public IP (v4 or v6) of the host. ipversion can be 4 to require ipv4, 6 to require ipv6, or 0 for either.

If a nil error is returned, the returned IP must be valid.

func Random32

func Random32() [32]byte

func RandomBytes

func RandomBytes(n int) []byte

func RandomHex

func RandomHex(n int) string

func RandomInt

func RandomInt(min, max int) int

func TrimHex

func TrimHex(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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