1 Star 0 Fork 0

sydeEvans/echo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
url.go 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
Vishal Rana 提交于 2016-06-29 12:14 . Fixed #587
// +build !appengine
package fasthttp
import "github.com/valyala/fasthttp"
type (
// URL implements `engine.URL`.
URL struct {
*fasthttp.URI
}
)
// Path implements `engine.URL#Path` function.
func (u *URL) Path() string {
return string(u.URI.PathOriginal())
}
// SetPath implements `engine.URL#SetPath` function.
func (u *URL) SetPath(path string) {
u.URI.SetPath(path)
}
// QueryParam implements `engine.URL#QueryParam` function.
func (u *URL) QueryParam(name string) string {
return string(u.QueryArgs().Peek(name))
}
// QueryParams implements `engine.URL#QueryParams` function.
func (u *URL) QueryParams() (params map[string][]string) {
params = make(map[string][]string)
u.QueryArgs().VisitAll(func(k, v []byte) {
_, ok := params[string(k)]
if !ok {
params[string(k)] = make([]string, 0)
}
params[string(k)] = append(params[string(k)], string(v))
})
return
}
// QueryString implements `engine.URL#QueryString` function.
func (u *URL) QueryString() string {
return string(u.URI.QueryString())
}
func (u *URL) reset(uri *fasthttp.URI) {
u.URI = uri
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sydeEvans/echo.git
git@gitee.com:sydeEvans/echo.git
sydeEvans
echo
echo
v2.2.0

搜索帮助