request

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package request 提供 HTTP 请求处理工具,包括参数校验等功能。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(s any)

Validate 对结构体执行参数校验,校验规则基于 validator v10 的 struct tag。 校验失败时直接 panic InvalidParam 异常,由框架 recover 中间件统一处理。

参数:

  • s: 待校验的结构体实例(需在字段上定义 validate tag)

注意:此函数会 panic,请确保在有 recover 中间件保护的 handler 链中调用。

Types

This section is empty.

Jump to

Keyboard shortcuts

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