go-querystring

go-querystring is Go library for encoding structs into URL query parameters.

  • 所有者: google/go-querystring
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

go-querystring

GoDoc Build Status

go-querystring is Go library for encoding structs into URL query parameters.

Usage

import "github.com/google/go-querystring/query"

go-querystring is designed to assist in scenarios where you want to construct a
URL using a struct that represents the URL query parameters. You might do this
to enforce the type safety of your parameters, for example, as is done in the
go-github library.

The query package exports a single Values() function. A simple example:

type Options struct {
  Query   string `url:"q"`
  ShowAll bool   `url:"all"`
  Page    int    `url:"page"`
}

opt := Options{ "foo", true, 2 }
v, _ := query.Values(opt)
fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2"

License

This library is distributed under the BSD-style license found in the LICENSE
file.

主要指标

概览
名称与所有者google/go-querystring
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2013-09-10 19:26:51
推送于2025-05-05 14:18:10
最后一次提交2025-04-24 07:22:41
发布数2
最新版本名称v1.1.0 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数2k
关注者数25
派生数180
提交数87
已启用问题?
问题数34
打开的问题数7
拉请求数24
打开的拉请求数11
关闭的拉请求数86
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?