querydec

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package querydec provides flexible query parameter decoding for HTTP requests.

This package defines a pluggable interface for parsing URL query parameters into structured data. It supports various decoding strategies and can be extended with custom implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode(values url.Values) (map[string]any, error)
}

Decoder turns url.Values into a normalized map tree.

type PlainDecoder

type PlainDecoder struct{}

PlainDecoder implements `?x=1&y=a` into flat map.

func (PlainDecoder) Decode

func (d PlainDecoder) Decode(v url.Values) (map[string]any, error)

Decode converts URL values to a flat map.

Parameters:

  • v: The URL values to decode.

Returns:

  • map[string]any: The decoded query parameters.
  • error: An error if decoding fails.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL