middleware

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Descripttion: 基础过滤器,用于扩展 * @version: 1.0.0 * @Author: lfzxs@qq.com * @Date: 2023-05-10 14:11:08 * @LastEditors: lfzxs@qq.com * @LastEditTime: 2023-05-11 15:14:06

* @Descripttion: 路径匹配过滤器 * @version: 1.0.0 * @Author: lfzxs@qq.com * @Date: 2023-05-09 14:56:49 * @LastEditors: lfzxs@qq.com * @LastEditTime: 2023-05-11 15:35:00

* @Descripttion:url 监控 * @version: v1.0.0 * @Author: lfzxs@qq.com * @Date: 2023-05-10 17:57:59 * @LastEditors: lfzxs@qq.com * @LastEditTime: 2023-05-11 15:21:13

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNotify added in v0.9.2

func AddNotify(bm *BaseMiddleware, fun NotifyFun)

func NewMatchMiddleware

func NewMatchMiddleware(name string, middleware ghttp.HandlerFunc, options ...MatchOption) *matchMiddleware

func NewMonitorMiddleware added in v0.9.2

func NewMonitorMiddleware(options ...MonitorOption) *monitorMiddleware

Types

type BaseMiddleware

type BaseMiddleware struct {
	// contains filtered or unexported fields
}

func (*BaseMiddleware) SendNotify added in v0.9.2

func (bm *BaseMiddleware) SendNotify(sender any, msg NotifyMap)

type MatchOption added in v0.9.1

type MatchOption func(mm *matchMiddleware)

func WithEnanle

func WithEnanle(enable bool) MatchOption

func WithExcludePath

func WithExcludePath(excludePath []string) MatchOption

设置忽略路径

func WithLogger added in v0.9.1

func WithLogger(logger slog.Logger) MatchOption

type MonitorOption added in v0.9.2

type MonitorOption func(mm *monitorMiddleware)

func WithNotifys added in v0.9.2

func WithNotifys(notifys []NotifyFun) MonitorOption

func WithShowHeader added in v0.9.2

func WithShowHeader(showHeader bool) MonitorOption

type NotifyFun added in v0.9.2

type NotifyFun = func(sender any, msg NotifyMap)

通知函数

type NotifyMap added in v0.9.2

type NotifyMap map[string]any

Jump to

Keyboard shortcuts

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