handler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package handler provides common utilities for HTTP handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRequest

func BindRequest[T any](r *http.Request) (T, *errors.Error)

BindRequest reads the request body, parses it into the target type using gopantic, and validates it. Returns the parsed value or a user-friendly error.

Usage:

req, bindErr := handler.BindRequest[CreateTransferRequest](r)
if bindErr != nil {
    response.Error(w, bindErr)
    return
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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