helpers

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxEmailLength = 254

Variables

This section is empty.

Functions

func DeepCopyMap added in v0.5.0

func DeepCopyMap[K comparable, V any](original map[K]V) map[K]V

DeepCopyMap is a generic function to copy a map with any key and value types.

func FileMove added in v0.4.6

func FileMove(sourcePath, destPath string) error

FileMove moves a file from a source path to a destination path. This must be used across the codebase for compatibility with Docker volumes and Golang (fixes Invalid cross-device link when using os.Rename)

func GetTargetURL added in v0.5.0

func GetTargetURL(reqURL *url.URL) *url.URL

GetTargetURL returns *url.URL with empty path, query and fragments parts.

func GetTargetURLStr added in v0.5.0

func GetTargetURLStr(reqURL *url.URL) string

GetTargetURLStr returns *url.URL with empty path, query and fragments parts as a string.

func HostPortFromUrl added in v0.5.0

func HostPortFromUrl(wafURL string, port uint16) (isTLS bool, hostPort string, err error)

HostPortFromUrl returns is TLS required flag and host:port string.

func ValidateEmail

func ValidateEmail(email string) (string, error)

Types

type Hash added in v0.4.12

type Hash interface {
	Hash() []byte
}

Jump to

Keyboard shortcuts

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