extend

package
v0.0.0-...-3e6627e Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtendsRegisterDefaultInit

func ExtendsRegisterDefaultInit(rootPath string)

ExtendsRegisterDefaultInit 扩展器初始化函数,可自定义

Types

type AssembleCustomWrapHandler

type AssembleCustomWrapHandler interface {
	AssembleCustomWrapHandlerFunc(handlers []gin.HandlerFunc) []gin.HandlerFunc
}

type ContextPath

type ContextPath interface {
	// SetContextPath 跟路径初始化函数
	SetContextPath(serverContextPathDefault string)
	// GetContextPath swagger 初始化时需要拼接根路径,调用此函数
	GetContextPath() string
}

type ContextPathDuplicateRemoval

type ContextPathDuplicateRemoval interface {
	DuplicateRemoval(openApi *openapi.OpenAPI)
}

ContextPathDuplicateRemoval http://localhost:8080/v3/api-docs 获取文档信息接口paths对象去掉跟路径

type CustomGinWrapHandler

type CustomGinWrapHandler interface {
	CustomGinWrapFunc(handler gin.HandlerFunc) gin.HandlerFunc
}

type CustomValidatorErrorRes

type CustomValidatorErrorRes interface {
	ValidatorErrorResFunc(c *gin.Context, e error) any
}

type ExtendsRegister

type ExtendsRegister struct {
	Cpdr ContextPathDuplicateRemoval // swagger查询api接口时,把根路径去掉,打开swagger页面时,url根路径会重复,如果没有重复可以不启用
	Vem  ValidatorErrorMessages      // 自定义Validator验证错误描述信息
	Cgwh CustomGinWrapHandler        // 自定义gin.handler包装器,默认为panic统一拦截器
	Acwh AssembleCustomWrapHandler   // 把每个gin.Handler包装一层自定义CustomGinWrapHandler
	Cver CustomValidatorErrorRes     // 自定义参数验证错误响应体,默认为自定义的Result结构体
	Cp   ContextPath                 // 根路径:http://localhost:8080/example/doc.html#  example为根路径
}
var ExtendsRegisterDefault ExtendsRegister

type ValidatorErrorMessages

type ValidatorErrorMessages interface {
	ErrorMessagesFunc(u interface{}, err error) string
}

Jump to

Keyboard shortcuts

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