routes

package
v0.0.0-...-351ec1d Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FooHandler

func FooHandler() http.Handler

FooHandler http.Handler

func FooHandlerFunc

func FooHandlerFunc(w http.ResponseWriter, r *http.Request)

FooHandlerFunc http处理器函数

func HealthCheck

func HealthCheck(ctx *gin.Context)

HealthCheck 监控检测

func WebRoute

func WebRoute(router *gin.Engine)

WebRoute gin web/api 路由设置

func WrapHTTPHandler

func WrapHTTPHandler(h http.Handler) gin.HandlerFunc

WrapHTTPHandler 将http handler包装为gin.HandlerFunc

func WrapHTTPHandlerFunc

func WrapHTTPHandlerFunc(h http.HandlerFunc) gin.HandlerFunc

WrapHTTPHandlerFunc 将http handlerFunc处理器函数包装为gin.HandlerFunc 由于http.Handler底层是一个interface上面有ServeHTTP方法 而http.HandlerFunc实现了http.Handler的ServeHTTP方法,就相当于实现了http.Handler接口 gin.Context包含了w http.ResponseWriter, r *http.Request 所以调用h.ServeHTTP然后包ctx.Writer,ctx.Request传入就可以处理http请求

Types

This section is empty.

Jump to

Keyboard shortcuts

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