rulesfn

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidHostLabel

func IsValidHostLabel(input string, allowSubDomains bool) bool

IsValidHostLabel returns if the input is a single valid RFC 1123 host label. If allowSubDomains is true, will allow validation to include nested host labels. Returns false if the input is not a valid host label. If errors occur they will be added to the provided [ErrorCollector].

func SubString

func SubString(input string, start, stop int, reverse bool) *string

Substring returns the substring of the input provided. If the start or stop indexes are not valid for the input nil will be returned. If errors occur they will be added to the provided [ErrorCollector].

func URIEncode

func URIEncode(input string) string

URIEncode returns an percent-encoded RFC3986 section 2.1 version of the input string.

Types

type URL

URL provides the structure describing the parts of a parsed URL returned by ParseURL.

func ParseURL

func ParseURL(input string) *URL

ParseURL returns a URL if the provided string could be parsed. Returns nil if the string could not be parsed. Any parsing error will be added to the [ErrorCollector].

If the input URL string contains an IP6 address with a zone index. The returned [builtin.URL.Authority] value will contain the percent escaped (%) zone index separator.

Jump to

Keyboard shortcuts

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