Documentation ¶
Index ¶
- func AppendURLValues(v1, v2 url.Values) url.Values
- func CondenseURI(uri string) string
- func EndpointString(path, method string, generic bool) string
- func GetPathLeaf(s string) (string, error)
- func GetURLBody(absoluteURL string) ([]byte, error)
- func GetURLPostBody(absoluteURL string, bodyType string, reqBody io.Reader) ([]byte, error)
- func IsHTTP(uri string, inclHTTP, inclHTTPS bool) bool
- func Join(elem ...string) string
- func JoinAbsolute(elem ...string) string
- func MatchGeneric(path1, path2 string) bool
- func ModifyPath(rawurl, newpath string) (string, error)
- func ParseURLTemplate(input string) (*url.URL, error)
- func SlugTextToURL(s string) string
- func SlugURLToText(s string) string
- func SplitPath(urlPath string, stripLeading, stripTrailing bool) []string
- func ToSlug(slug []byte) []byte
- func ToSlugLowerString(s string) string
- func URIHasScheme(uri string) bool
- func URIScheme(uri string) string
- func URLAddQuery(inputURL *url.URL, qry map[string][]string) *url.URL
- func URLAddQueryInterfaceString(inputURL string, qry interface{}) (*url.URL, error)
- func URLAddQueryString(inputURL string, qry map[string][]string) (*url.URL, error)
- func URLAddQueryValues(inputURL *url.URL, qry url.Values) *url.URL
- func URLAddQueryValuesString(inputURL string, qry url.Values) (*url.URL, error)
- func URLValuesEncodeSorted(v url.Values, priorities []string) string
- func VarsToGeneric(input string) string
- type URLMore
- type URLValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendURLValues ¶
AppendURLValues appends one url.Values to another url.Values.
func CondenseURI ¶ added in v0.37.0
CondenseURI trims spaces and condenses slashes.
func EndpointString ¶
func GetPathLeaf ¶
func GetURLBody ¶
GetURLBody returns an HTTP response byte array body from a URL.
func GetURLPostBody ¶
GetURLPostBody returns a HTTP post body as a byte array from a URL, body type and an io.Reader.
func JoinAbsolute ¶
JoinAbsolute performs a path.Join() while preserving two slashes after the scheme.
func MatchGeneric ¶
func ModifyPath ¶
func ParseURLTemplate ¶
ParseURLTemplate exists to parse templates with variables that do not meet RFC specifications. For example: https://{customer}.example.com:{port}/v5 "invalid URL escape "%7B"" for `{` within a Hostname or "invalid port ":{port}" after host"
func SlugTextToURL ¶ added in v0.37.0
func SlugURLToText ¶ added in v0.37.0
func SplitPath ¶
SplitPath splits a URL path string with optional removal of leading and trailing slashes.
func ToSlug ¶
ToSlug creates a slug byte array from an input byte array. Slugs have words separated by a hyphen with no punctuation or spaces.
func ToSlugLowerString ¶
ToSlugLowerString creates a lower-cased slug string
func URIHasScheme ¶ added in v0.37.0
URIHasScheme returns a boolean true or false if the string has a URI scheme.
func URIScheme ¶ added in v0.37.0
URIScheme extracts the URI scheme from a string. It returns an empty string if none is encountered.
func URLAddQueryString ¶
func URLAddQueryValuesString ¶
func URLValuesEncodeSorted ¶ added in v0.37.0
URLValuesEncodeSorted returns and encoded string with sorting
func VarsToGeneric ¶
Types ¶
type URLMore ¶
UrlMore provides additional URL parsing and reconstruction capabilties above and beyond URL. Specifically it can parse out the port number and return URLs that strip off the target fragment as well as the query string.
func NewURLMore ¶
func NewURLMore() URLMore
type URLValidator ¶
func (*URLValidator) RequiredSchemesSorted ¶
func (uv *URLValidator) RequiredSchemesSorted() []string
func (*URLValidator) RequiredSchemesSortedString ¶
func (uv *URLValidator) RequiredSchemesSortedString() string
func (*URLValidator) SchemesToLower ¶
func (uv *URLValidator) SchemesToLower()
func (*URLValidator) ValidateURL ¶
func (*URLValidator) ValidateURLString ¶
func (uv *URLValidator) ValidateURLString(s string) (*url.URL, error)