urlx

package
v0.0.0-...-cb58a95 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 来自 http://www.iana.org/domains/root/db
	TopLevelDomains = []string{}/* 1559 elements not displayed */

	TopLevelDomainsSet = stringsx.SetOf(TopLevelDomains...)
)

Functions

func Abs

func Abs(baseURL, path string) string

func EncodeQuery

func EncodeQuery(q map[string]string) string

func EncodeValues

func EncodeValues(v url.Values, mode EscapeEncoding) string

func HostOf

func HostOf(urlStr string, withPort, topLevel bool) string

func Join

func Join(p ...string) string

func JoinHostAndPort

func JoinHostAndPort(host string, port int) string

func QueryEscape

func QueryEscape(s string, mode EscapeEncoding) string

func SplitPort

func SplitPort(hostAndPort string) (string, int)

func ToValues

func ToValues(q map[string]string) url.Values

func TopLevelDomainOfHost

func TopLevelDomainOfHost(hostAndPort string, withPort bool) string

Types

type EscapeEncoding

type EscapeEncoding int
const (
	EscapeEncodePath EscapeEncoding = 1 + iota
	EscapeEncodeHost
	EscapeEncodeZone
	EscapeEncodeUserPassword
	EscapeEncodeQueryComponent
	EscapeEncodeFragment
)

Jump to

Keyboard shortcuts

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