handler

package
v0.0.0-...-7404c28 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package handler NOTES

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS(next http.Handler) http.Handler

CORS 跨域

func HTTPMiddleware

func HTTPMiddleware(root http.Handler, handlers ...Handler) http.Handler

HTTPMiddleware is the http middleware that adds common handler to root http handler

func RegisterCommonHandler

func RegisterCommonHandler() http.Handler

RegisterCommonHandler 统一的 metrics 函数

func RegisterCommonToolHandler

func RegisterCommonToolHandler() http.Handler

RegisterCommonToolHandler 统一的 metrics / ctl 函数

func RequestBodyLogger

func RequestBodyLogger(ignorePattern ...string) func(http.Handler) http.Handler

RequestBodyLogger 记录 requetBody 的中间件

func RequestID

func RequestID(next http.Handler) http.Handler

RequestID middleware

func RequestIdGenerator

func RequestIdGenerator() string

RequestIdGenerator request_id

func ReverseProxyHandler

func ReverseProxyHandler(name, prefix, remoteURL string) http.Handler

ReverseProxyHandler 代理请求

Types

type Handler

type Handler struct {
	Pattern string
	Handler http.Handler
}

Handler defines http handlers to add to http service

Jump to

Keyboard shortcuts

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