query

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

pantry/query/query.go

Index

Constants

View Source
const MaxSearchLen = 200

MaxSearchLen is the default maximum length for search query parameters.

Variables

This section is empty.

Functions

func Get

func Get(r *http.Request, key string) string

Get returns the trimmed value of a query parameter. Returns an empty string if the parameter is missing or blank.

func GetMax

func GetMax(r *http.Request, key string, maxLen int) string

GetMax returns the trimmed value of a query parameter, truncated to maxLen. Returns an empty string if the parameter is missing or blank.

func Search(r *http.Request, key string) string

Search returns a search query parameter, truncated to MaxSearchLen. Use this for search/filter inputs that will be used in database queries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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