aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/google/go-querystring/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/google/go-querystring/README.md')
-rw-r--r--vendor/github.com/google/go-querystring/README.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/github.com/google/go-querystring/README.md b/vendor/github.com/google/go-querystring/README.md
new file mode 100644
index 0000000..0e600be
--- /dev/null
+++ b/vendor/github.com/google/go-querystring/README.md
@@ -0,0 +1,37 @@
1# go-querystring #
2
3[![GoDoc](https://godoc.org/github.com/google/go-querystring/query?status.svg)](https://godoc.org/github.com/google/go-querystring/query) [![Build Status](https://travis-ci.org/google/go-querystring.svg?branch=master)](https://travis-ci.org/google/go-querystring)
4
5go-querystring is Go library for encoding structs into URL query parameters.
6
7## Usage ##
8
9```go
10import "github.com/google/go-querystring/query"
11```
12
13go-querystring is designed to assist in scenarios where you want to construct a
14URL using a struct that represents the URL query parameters. You might do this
15to enforce the type safety of your parameters, for example, as is done in the
16[go-github][] library.
17
18The query package exports a single `Values()` function. A simple example:
19
20```go
21type Options struct {
22 Query string `url:"q"`
23 ShowAll bool `url:"all"`
24 Page int `url:"page"`
25}
26
27opt := Options{ "foo", true, 2 }
28v, _ := query.Values(opt)
29fmt.Print(v.Encode()) // will output: "q=foo&all=true&page=2"
30```
31
32[go-github]: https://github.com/google/go-github/commit/994f6f8405f052a117d2d0b500054341048fbb08
33
34## License ##
35
36This library is distributed under the BSD-style license found in the [LICENSE](./LICENSE)
37file.