Utility package that provides the ability to more conveniently work with URL parameters.

Overview

QueryParams

Utility package that provides the ability to more conveniently work with URL parameters.

Install

go get github.com/mozg1984/queryparams

Import

import (
        "github.com/mozg1984/queryparams"
)

Usage example

package main

import (
	"fmt"
	"net/http"

	"github.com/mozg1984/queryparams"
)

func myHandler(w http.ResponseWriter, r *http.Request) {
	// p1=hello&p2=1&p3=2.3&p4=0&p4=1&p4=2
	params := NewQueryParams(r.URL)

	fmt.Println(params.GetString("p1")) // hello
	
	p2, _ := params.GetUint("p2")
	fmt.Println(p2) // 1

	p3, _ := params.GetFloat("p3")
	fmt.Println(p3) // 2.3
	
	fmt.Println(params.GetStrings("p4")) // [0 1 2]

	unk, _ := params.GetInt32("unknown", -1)
	fmt.Println(unk) // -1
}

func main() {
	http.HandleFunc("/", myHandler)
	http.ListenAndServe(":8080", nil)
}

License

MIT

Owner
Radik Khisamutdinov
Radik Khisamutdinov
Utility to restrict which package is allowed to import another package.

go-import-rules Utility to restrict which package is allowed to import another package. This tool will read import-rules.yaml or import-rules.yml in t

PAYFAZZ 0 Jan 7, 2022
A Golang and Python solution for Queue-it's Proof-of-Work challenge.

Queue-it Proof-of-Work A Golang and Python solution for Queue-it's Proof-of-Work challenge (https://queue-it.com/blog/proof-of-work-block-bad-bots/).

eta 24 Jun 30, 2022
Listing git repository from URL/User/Org

This tool is available when the repository, such as github, is included in the bugbounty scope. Sometimes specified as an org name or user name rather than a specific repository, you can use this tool to extract url from all public repositories included in the org/user.

HAHWUL 39 Jun 21, 2022
🏮Blazing fast URL shortener made with simplicity in mind

klein Blazing fast URL shortener made with simplicity in mind Structures The project is what people would call a "monolith".

sach1 19 Feb 16, 2022
🏮 ― Blazing fast URL shortener made with simplicity in mind

klein Blazing fast URL shortener made with simplicity in mind Run As easy as filling out config/config.yaml and running make. Of course, you need to h

Pink Cigarette 19 Feb 16, 2022
Configuration based URL shortner useful for on page 301 redirects

GO_URL_SHORT Configuration based URL shortner useful for on page 301 redirects Configuration for shortened url can be loaded from a JSON file in forma

piyush 0 Oct 16, 2021
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite

go-testdeep Extremely flexible golang deep comparison, extends the go testing package. Latest news Synopsis Description Installation Functions Availab

Maxime Soulé 313 Aug 8, 2022
keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

keeper is package for Go that provides a mechanism for waiting a result of execution function until context cancel.

Gunosy 5 Apr 18, 2022
Package truthy provides truthy condition testing with Go generics

Truthy Truthy is a package which uses generics (Go 1.18+) to create useful boolean tests and helper functions. Examples // truthy.Value returns the tr

Carl Johnson 30 Jul 24, 2022
Go-path - A helper package that provides utilities for parsing and using ipfs paths

go-path is a helper package that provides utilities for parsing and using ipfs paths

y 0 Jan 18, 2022
Copier for golang, copy value from struct to struct and more

Copier I am a copier, I copy everything from one to another Features Copy from field to field with same name Copy from method to field with same name

Jinzhu 3.4k Aug 6, 2022
Steampipe plugin to query your Scalingo apps, addons and more

Scalingo plugin for Steampipe Use SQL to query infrastructure including applications and addons from Scalingo. Get started → Documentation: Table defi

François de Metz 10 Jul 14, 2022
💪 Helper Utils For The Go: string, array/slice, map, format, cli, env, filesystem, test and more.

?? Helper Utils For The Go: string, array/slice, map, format, cli, env, filesystem, test and more. Go 的一些工具函数,格式化,特殊处理,常用信息获取等等

Gookit 882 Aug 11, 2022
F - Experimenting with Go 1.18 generics to write more functional Go code

f f is a simple library that leverages the new generics in Golang to create a tools for functional style of code. Pipe like '|>' in Elixir or Elm. inp

Amirreza Askarpour 3 Apr 12, 2022
Leftright - A concurrent map that is optimized for scenarios where reads are more frequent than writes

leftright A concurrent map that is optimized for scenarios where reads are more

Yang Pan 1 Jan 30, 2022
A super simple Lodash like utility library with essential functions that empowers the development in Go

A simple Utility library for Go Go does not provide many essential built in functions when it comes to the data structure such as slice and map. This

Rahul Baruri 127 Jul 9, 2022
Robust & Easy to use struct mapper and utility methods for Go

go-model Robust & Easy to use model mapper and utility methods for Go struct. Typical methods increase productivity and make Go development more fun ?

Jeevanandam M. 356 Aug 8, 2022
gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools.

gopkg is a universal utility collection for Go, it complements offerings such as Boost, Better std, Cloud tools. Table of Contents Introduction

Bytedance Inc. 738 Aug 2, 2022
Utility to add network config file in apk

Utility to add network config file in apk. Which bypass the proxy intercept restriction for user installed burpsuit CA certificate.

dwij patel 3 May 11, 2021