package rulesfn

import "github.com/aws/smithy-go/endpoints/private/rulesfn"

Index

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

type URL struct {
	Scheme         string // https://www.rfc-editor.org/rfc/rfc3986#section-3.1
	Authority      string // https://www.rfc-editor.org/rfc/rfc3986#section-3.2
	Path           string // https://www.rfc-editor.org/rfc/rfc3986#section-3.3
	NormalizedPath string // https://www.rfc-editor.org/rfc/rfc3986#section-6.2.3
	IsIp           bool
}

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.

Source Files

doc.go strings.go uri.go

Version
v1.22.3 (latest)
Published
Feb 17, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
3 weeks ago

Tools for package owners.