url

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TLDs = `` /* 43914-byte string literal not displayed */

TLDS is a list of active tlds from ICANN

Functions

func UrlDecode

func UrlDecode(str string) (string, error)

url decode string

func UrlEncode

func UrlEncode(str string) string

url encode string, is + not %20

Types

type XURL

type XURL struct {
	URL        string
	Scheme     string
	User       string
	Password   string
	Hostname   string
	Subdomain  string
	Domain     string
	TLD        string
	Port       string
	Path       string
	Query      string
	Fragment   string
	File       string
	FileName   string
	FileSuffix string
}

XURL contains the parts of URL after parsing

func Parse

func Parse(url string) (*XURL, error)

Parse accepts (or treats the input as) an absolute URL string

func (*XURL) String

func (url *XURL) String() string

Returns normalized version of url based on XURL parts

Jump to

Keyboard shortcuts

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