Categorygithub.com/randomhajile/paramware
modulepackage
0.0.0-20241212135441-7bbfcab4b02c
Repository: https://github.com/randomhajile/paramware.git
Documentation: pkg.go.dev

# README

paramware

Simple middlware for handling expected query parameters in Gin.

Usage

Simply import this module and add the middleware before the handler that requires the given parameter, e.g.

router.GET(
    "/widgets",
    paramware.Int64Param("intParam", 11),
    paramware.StringParam("stringParam", "foo"),
    getWidgets,
)

# Functions

BoolParam adds a boolean param to the gin context.
Int64Param adds an int param to the gin context.
SetParam generic function that can be used to get any kind of parameter.
StringParam adds a string param to the gin context.