Documentation
¶
Index ¶
- type URL
- func (x *URL) Fragment() string
- func (x *URL) Host() string
- func (x *URL) Hostname() string
- func (x *URL) Path() string
- func (x *URL) Port() string
- func (x *URL) Query() url.Values
- func (x *URL) QueryValue(key string) string
- func (x *URL) Raw() string
- func (x *URL) Scheme() string
- func (x *URL) String() string
- func (x *URL) URL() *url.URL
- func (x *URL) User() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type URL ¶
type URL struct {
// contains filtered or unexported fields
}
func Parse ¶
Parse 将任意字符串解析为 *murl.URL。
如果输入缺少 scheme(例如 "example.com/path"),函数会尝试在前面加上 "http://" 再解析。 返回值:解析成功返回封装后的 *URL;解析失败返回非 nil 的错误。 可能的错误包括 net/url 提供的解析错误。
func (*URL) QueryValue ¶
QueryValue 返回指定 query key 的第一个值,若不存在则返回空字符串。
Click to show internal directories.
Click to hide internal directories.