urls

package
v1.22.7 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendArgs

func AppendArgs(rawUrl string, kvs ...string) string

AppendArgs 往 url 中添加 query 参数

添加参数按照键值对的顺序依次传递到函数中, 仅出现偶数个参数才会成功匹配出一个 query 参数

如果在拼接的过程中出现任何异常, 会返回 rawUrl 而不作任何修改

func DecodeURI added in v1.11.4

func DecodeURI(uri string) string

DecodeURI 将 uri 进行 query 解码

func ReplaceAll

func ReplaceAll(rawUrl string, oldNews ...string) string

ReplaceAll 类似于 strings.ReplaceAll

区别在于可以一次性传入多个子串进行替换

func ResolveResourceName

func ResolveResourceName(resUrl string) string

ResolveResourceName 解析一个资源 url 的名称

比如 http://example.com/a.txt?a=1&b=2 会返回 a.txt

func TransferSlash

func TransferSlash(p string) string

TransferSlash 将传递的路径的斜杠转换为正斜杠

如果传递的参数不是一个路径, 不作任何处理

Types

This section is empty.

Jump to

Keyboard shortcuts

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