util

package
v0.0.7-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeFilePath

func EscapeFilePath(path string) string

func IsEmpty

func IsEmpty(dir string) bool

func IsPrivateSubnet

func IsPrivateSubnet(ip net.IP) bool

Returns true if the provided IP falls within a private address range

func LocalAddresses

func LocalAddresses() ([]string, error)

Parses a list of usable local IP addresses

func NewID

func NewID(input []byte) uint64

func ParseFQDN

func ParseFQDN(anyURL string) (string, error)

Returns the Fully Qualified Domain Name for a given URL

func PreferredIPv4

func PreferredIPv4() net.IP

Performs a logical UDP connection to an endpoint that does not need to exist and returns the local IP address that was used to perform the connection.

func PreferredIPv6

func PreferredIPv6() net.IP

Performs a logical UDP connection to an endpoint that does not need to exist and returns the local IP address that was used to perform the connection.

func SerialNumber

func SerialNumber() (*big.Int, error)

Types

type LeakyBucket

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

func NewLeakyBucket

func NewLeakyBucket(capacity int, window time.Duration) *LeakyBucket

Creates a new rate limiter using the leaky bucket algorithm

func (*LeakyBucket) AllowRequest

func (b *LeakyBucket) AllowRequest() bool

Jump to

Keyboard shortcuts

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