url

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 4 Imported by: 72

Documentation

Overview

Package url define URL utilites

Index

Constants

View Source
const (
	//Localhost default host
	Localhost = "localhost"
)

Variables

This section is empty.

Functions

func Base

func Base(URL string, defaultSchema string) (string, string)

Base returns base URL and URL path

func Dir added in v1.23.0

func Dir(URL string) string

Dir returns director

func Equals added in v0.3.1

func Equals(URL1, URL2 string) bool

Equals checks if url are the same

func Host

func Host(URL string) string

Host extract host from URL

func IsRelative added in v0.12.2

func IsRelative(location string) bool

IsRelative returns true if location is relative path

func IsSchemeEquals added in v0.4.0

func IsSchemeEquals(URL1, URL2 string) bool

IsSchemeEquals returns true if scheme is equals

func Join

func Join(baseURL string, elements ...string) string

Join joins base URL with path elements

func JoinUNC added in v0.14.0

func JoinUNC(baseURL string, fragments ...string) string

JoinUNC joins base URL with path elements, it support '.' or '..' elements

func Normalize

func Normalize(URL, scheme string) string

Normalize normalizes URL

func Path

func Path(URL string) string

Path returns path for an URL or path

func Scheme

func Scheme(URL, defaultSchema string) string

Scheme extracts URL scheme

func SchemeExtensionURL

func SchemeExtensionURL(URL string) string

SchemeExtensionURL extract scheme extension or empty string

func Split

func Split(URL, defaultScheme string) (string, string)

Split splits URL with the last URI element and its parent path

Types

This section is empty.

Jump to

Keyboard shortcuts

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