urlz

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package urlz contains URL utility functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryParamKeys

func QueryParamKeys(query string) (keys []string, err error)

QueryParamKeys returns the keys of a URL query. This function exists because url.ParseQuery returns a url.Values, which is a map type, and the keys don't preserve order.

func RenameQueryParamKey

func RenameQueryParamKey(query, oldKey, newKey string) string

RenameQueryParamKey renames all instances of oldKey in query to newKey, where query is a URL query string.

func StripPath

func StripPath(u url.URL, stripQuery bool) string

StripPath strips the url's path. If stripQuery is true, the query is also stripped.

func StripQuery

func StripQuery(u url.URL) string

StripQuery strips the query params from u.

func StripScheme

func StripScheme(u url.URL) string

StripScheme removes the URL's scheme.

func StripSchemeAndUser

func StripSchemeAndUser(u url.URL) string

StripSchemeAndUser removes the URL's scheme and user info.

func StripUser

func StripUser(u url.URL) string

StripUser strips the URL's user info.

Types

This section is empty.

Jump to

Keyboard shortcuts

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