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: 0

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