go-querystring

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

  • Owner: google/go-querystring
  • Platform:
  • License:: BSD 3-Clause "New" or "Revised" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownergoogle/go-querystring
Primary LanguageGo
Program languageGo (Language Count: 1)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2013-09-10 19:26:51
Pushed At2025-05-05 14:18:10
Last Commit At2025-04-24 07:22:41
Release Count2
Last Release Namev1.1.0 (Posted on )
First Release Namev1.0.0 (Posted on )
用户参与
Stargazers Count2k
Watchers Count25
Fork Count180
Commits Count87
Has Issues Enabled
Issues Count34
Issue Open Count7
Pull Requests Count24
Pull Requests Open Count11
Pull Requests Close Count86
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private