提交 8711c663 作者: Jeromy

make opt skip map a global

License: MIT
Signed-off-by: 's avatarJeromy <jeromyj@gmail.com>
上级 de702ead
......@@ -23,6 +23,10 @@ const (
ApiPath = "/api/v0" // TODO: make configurable
)
var OptionSkipMap = map[string]bool{
"api": true,
}
// Client is the commands HTTP client interface.
type Client interface {
Send(req cmds.Request) (cmds.Response, error)
......@@ -141,13 +145,9 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
}
func getQuery(req cmds.Request) (string, error) {
// some options should be kept clientside, the server doesnt care
skip := map[string]bool{
"api": true,
}
query := url.Values{}
for k, v := range req.Options() {
if skip[k] {
if OptionSkipMap[k] {
continue
}
str := fmt.Sprintf("%v", v)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论