url

package
v1.15.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendQueryParam added in v1.5.11

func AppendQueryParam(url string, param interface{}) string

func AppendQueryParamByTag added in v1.5.11

func AppendQueryParamByTag(url string, param interface{}, tag string) string

func Base

func Base(url string) string

获取url中非参数部分

func Clean

func Clean(p string) string

Clean is the URL version of path.Clean, it returns a canonical URL path for p, eliminating . and .. elements.

The following rules are applied iteratively until no further processing can be done:

  1. Replace multiple slashes with a single slash.
  2. Eliminate each . path name element (the current directory).
  3. Eliminate each inner .. path name element (the parent directory) along with the non-.. element that precedes it.
  4. Eliminate .. elements that begin a rooted path: that is, replace "/.." by "/" at the beginning of a path.

If the result of this process is an empty string, "/" is returned

func PathBase added in v1.5.11

func PathBase(url string) string

获取url中的文件名

func QueryParam added in v1.5.11

func QueryParam(param any) string

func QueryParamByTag added in v1.5.11

func QueryParamByTag(param any, tag string) string

func RelativeURLToAbsoluteURL

func RelativeURLToAbsoluteURL(curURL string, baseURL string) (string, error)

RelativeURLToAbsoluteURL 相对URL转绝对URL

func ResolveURL added in v1.5.11

func ResolveURL(u *url.URL, p string) string

func SetTag added in v1.5.11

func SetTag(t string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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