gin

package
v0.0.0-...-bcb142e Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GinUtil

type GinUtil struct{}

func (GinUtil) ControllerRegister

func (this GinUtil) ControllerRegister(url string, handler func(ctx *gin.Context) interface{}, iTypes ...RequestType)

注册web接口

func (GinUtil) Cors

func (this GinUtil) Cors() gin.HandlerFunc

跨域函数

func (GinUtil) GetController

func (this GinUtil) GetController() map[string]HttpHandleInfo

取注册的web接口

func (GinUtil) GetHandleFunc

func (this GinUtil) GetHandleFunc(urlKey string, iType RequestType, InterceptorFunc func(ctx *gin.Context) bool,
	controllerMap map[string]HttpHandleInfo) func(ctx *gin.Context)

取注册的web接口

func (GinUtil) RegisterController

func (this GinUtil) RegisterController(url string, iTypes interface{}, handler func(ctx *gin.Context) interface{})

注册web接口

func (GinUtil) RegisterControllers

func (this GinUtil) RegisterControllers(url string, iTypes interface{}, handler func(ctx *gin.Context) interface{})

注册web接口

func (GinUtil) SetCors

func (this GinUtil) SetCors(r *gin.Engine)

设置跨域

func (GinUtil) SetStatic

func (this GinUtil) SetStatic(r *gin.Engine, webroot string)

设置静态路径

type HttpHandleInfo

type HttpHandleInfo struct {
	Url  string
	Type RequestType
	Fun  func(ctx *gin.Context) interface{}
}

http控制层接口信息

type RequestType

type RequestType string

请求类型枚举

const (
	GET     RequestType = "GET"
	POST    RequestType = "POST"
	DELETE  RequestType = "DELETE"
	PUT     RequestType = "PUT"
	OPTIONS RequestType = "OPTIONS"
)

func (RequestType) String

func (rt RequestType) String() string

枚举转字符串

Jump to

Keyboard shortcuts

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