middlewares

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 17 Imported by: 2

Documentation

Overview

prometheus中间件

Index

Constants

View Source
const (
	LabelValueTenantPlatform = "platform"

	XForwardedUri    = "X-Forwarded-Uri"
	XForwardedMethod = "X-Forwarded-Method"
	XForwardedHost   = "X-Forwarded-Host"
	XForwardedProto  = "X-Forwarded-Proto"
)

Variables

View Source
var (
	URLCACHE_GET         string = "/apis/v1/urlcache/:name"
	URLCACHEALL_GET      string = "/apis/v1/urlcache"
	URLCACHE_FORWARDAUTH string = "/forwardauth"
)
View Source
var NoRoutePath string = "/admin/index"

默认404跳转地址

View Source
var WhilteList []string = []string{
	"URLCACHE_GET", "URLCACHEALL_GET", "URLCACHE_FORWARDAUTH",
}

平台级别白名单列表

Functions

func Cors

func Cors() gin.HandlerFunc

跨域设置

func NoRouteHandler

func NoRouteHandler(c *gin.Context)

404 handler

func PromHandler

func PromHandler(handler http.Handler) gin.HandlerFunc

func RegisterHealthMiddleware

func RegisterHealthMiddleware(c *gin.Context)

@Summary 健康检查 @Description 接口健康检查接口 @Tags Health @Success 200 {string} string "success" @Router /health [get]

func RegisterIndex

func RegisterIndex(c *gin.Context)

func RegisterPrometheusMiddleware

func RegisterPrometheusMiddleware(router *gin.Engine, isauth bool)

默认prometheus监控+自定义监控

func RegisterSwaggerMiddleware

func RegisterSwaggerMiddleware(router *gin.Engine)

func RegisterUrlCache

func RegisterUrlCache(router *gin.Engine)

注册UrlCache接口

Types

This section is empty.

Jump to

Keyboard shortcuts

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