url类

package
v0.0.0-...-782a3f7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

包gurl提供了处理URL的有用API。 md5:3954efb697af4a41

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func X生成URL

func X生成URL(查询参数 url.Values) string

X生成URL 生成 URL 编码的查询字符串。 参考:http://php.net/manual/zh/function.http-build-query.php。 md5:f0e4222e29189a30

func X编码

func X编码(文本 string) string

X编码将字符串进行转义,以便安全地放置在URL查询中。 md5:2e139b94de8d8e81

func X编码RFC3986

func X编码RFC3986(文本 string) string

X编码RFC3986 按照 RFC 3986 标准对给定的字符串进行原始URL编码。 参考 http://php.net/manual/en/function.rawurlencode.php。 md5:b116dd32b351afc8

func X解析

func X解析(文本 string, 类型标签 int) (map[string]string, error)

X解析 解析一个URL并返回其组成部分。 参数可选值:-1表示全部;1表示方案(scheme);2表示主机(host);4表示端口(port); 8表示用户名(user);16表示密码(pass);32表示路径(path); 64表示查询字符串(query);128表示片段(fragment)。 参考 PHP 手册中的函数 parse-url:http://php.net/manual/en/function.parse-url.php。 md5:ab33f23dd1fe61ca

func X解码

func X解码(文本 string) (string, error)

X解码 执行与 Encode 相反的转换, 将形如 "%AB" 的每3字节编码子串转换为其十六进制解码字节 0xAB。 如果任何百分号(%)后面没有跟随两个十六进制数字,它将返回一个错误。 md5:c8ff43c799b800c0

func X解码RFC3986

func X解码RFC3986(文本 string) (string, error)

X解码RFC3986 用于解码给定的字符串 解码 URL 编码的字符串。 参考:http://php.net/manual/zh/function.rawurldecode.php md5:ffbb20457d038fe3

Types

This section is empty.

Jump to

Keyboard shortcuts

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