utils

package
v0.0.0-...-a9450b3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertStruct

func AssertStruct(s any, setErrOpts ...errors.SetErrorOptions)

断言结构

func ParseAndAssertRequestBody

func ParseAndAssertRequestBody(ctx *gin.Context, val any)

解析并断言请求体

func ParseRequestBody

func ParseRequestBody(ctx *gin.Context, val any) *errors.AppError

解析请求体

func StrInSlice

func StrInSlice(str string, slice []string) bool

字符串是否存在于切片中

func StructToMap

func StructToMap(s any) map[string]any

将结构转换为字符串Map

func ValidteStruct

func ValidteStruct(s any, setErrOpts ...errors.SetErrorOptions) *errors.AppError

校验结构。根据结构的定义执行校验

Types

This section is empty.

Jump to

Keyboard shortcuts

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