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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?