All Projects → derekstavis → go-qs

derekstavis / go-qs

Licence: MIT license
A Go port of Rack's query string parser

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-qs

micell
A collection of functions for front-end development
Stars: ✭ 16 (-83.33%)
Mutual labels:  url, querystring
uri-query-parser
a parser and a builder to work with URI query string the right way in PHP
Stars: ✭ 38 (-60.42%)
Mutual labels:  url, query
Use Query Params
React Hook for managing state in URL query parameters with easy serialization.
Stars: ✭ 1,278 (+1231.25%)
Mutual labels:  url, query
URLQueryItemEncoder
A Swift Encoder for encoding any Encodable value into an array of URLQueryItem.
Stars: ✭ 60 (-37.5%)
Mutual labels:  url, query
use-route-as-state
Use React Router route and query string as component state
Stars: ✭ 37 (-61.46%)
Mutual labels:  url, querystring
ts-mongodb-orm
Typescript Orm wrapper for Mongodb
Stars: ✭ 13 (-86.46%)
Mutual labels:  query
Fraud-Detection-in-Online-Transactions
Detecting Frauds in Online Transactions using Anamoly Detection Techniques Such as Over Sampling and Under-Sampling as the ratio of Frauds is less than 0.00005 thus, simply applying Classification Algorithm may result in Overfitting
Stars: ✭ 41 (-57.29%)
Mutual labels:  query
web-session-counter
Utility to count a user's web sessions based on the definition GA uses.
Stars: ✭ 22 (-77.08%)
Mutual labels:  querystring
commons
Ad-hoc collection of re-usable Java classes.
Stars: ✭ 15 (-84.37%)
Mutual labels:  url
URL-Shortner-Bot-V2
A link shortner telegram bot version 2 with advanced features
Stars: ✭ 18 (-81.25%)
Mutual labels:  url
Rhythm-CB-Scripts
Collection of scripts for use with Carbon Black Cb Response API
Stars: ✭ 14 (-85.42%)
Mutual labels:  query
minecraft-server-status
PHP library to check Minecraft Servers Status
Stars: ✭ 36 (-62.5%)
Mutual labels:  query
spring-filter
Painless filtering library for JPA entities and MongoDB collections. Smoothly integrates with Spring APIs.
Stars: ✭ 123 (+28.13%)
Mutual labels:  query
SimplePHP
A small query builder project designed to assist daily routines and speed up the process of communicating with the database.
Stars: ✭ 14 (-85.42%)
Mutual labels:  query
short
URL shortening service. 高性能短链接服务。
Stars: ✭ 14 (-85.42%)
Mutual labels:  url
postcss-flexible
🔲 dpr/rem/url transformer for flexible
Stars: ✭ 19 (-80.21%)
Mutual labels:  url
python-qlient
A fast and modern graphql client designed with simplicity in mind.
Stars: ✭ 29 (-69.79%)
Mutual labels:  query
use-query-string
🆙 A React hook that serializes state into the URL query string
Stars: ✭ 50 (-47.92%)
Mutual labels:  querystring
AdvancedSQL
The best Java query builder/SQL connector.
Stars: ✭ 23 (-76.04%)
Mutual labels:  query
anapsid
An adaptive query processing engine for SPARQL endpoints.
Stars: ✭ 17 (-82.29%)
Mutual labels:  query

Guitar String

go-qs

Go port of Rack's query strings

Build Status

This package was written as I haven't found a good package that understands Rack/Rails query string format.

It have been designed to marshal and unmarshal nested query strings from/into map[string]interface{}, inspired on the interface of Go builtin json package.

Compatibility

go-qs is a port of Rack's code. All tests included into test suite are also a port of Rack tests, so this package keeps great compatibility with Rack implementation.

Usage

Unmarshal

To unmarshal query strings to a map[string]interface{}:

package main

import (
  "fmt"
  "github.com/derekstavis/go-qs"
)

query, err := qs.Unmarshal("foo=bar&names[]=foo&names[]=bar")

if err != nil {
  fmt.Printf("%#+v\n", query)
}

The output:

map[string]interface {}{"foo":"bar", "names":[]interface {}{"foo", "bar"}}

Marshal

You can also marshal a map[string]interface{} to a query string:

package main

import (
  "fmt"
  "github.com/derekstavis/go-qs"
)

payload := map[string]interface {}{"foo":"bar", "names":[]interface {}{"foo", "bar"}}

querystring, err := qs.Marshal(payload)

if err != nil {
  fmt.Printf(querystring)
}

The output:

foo=bar&names[]=foo&names[]=bar

License

MIT Copyright (c) 2016 Derek W. Stavis
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].