middleware

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBlacklist

func CheckBlacklist(asAPI bool) fiber.Handler

CheckBlacklist 接口黑名单检查

func CheckPathOr404

func CheckPathOr404() fiber.Handler

CheckPathOr404 检查 URL 是否为配置中的路由

func CheckWhitelist

func CheckWhitelist(asAPI bool) fiber.Handler

CheckWhitelist 接口白名单检查

func CounterStats

func CounterStats() map[string]any

func DefaultLogCondition

func DefaultLogCondition(c *fiber.Ctx, elapsed time.Duration) bool

func HTTPCounter

func HTTPCounter(name string) fiber.Handler

HTTPCounter 请求简单计数

func RecoverLogger

func RecoverLogger() fiber.Handler

RecoverLogger Recover 并记录日志

func ResetStatistics added in v0.0.16

func ResetStatistics()

ResetStatistics 重置统计数据

func WebLogger

func WebLogger(cond LogCondition) fiber.Handler

WebLogger Web 日志

func WithTimeout

func WithTimeout(dur time.Duration, timeoutErrors ...error) fiber.Handler

WithTimeout 附加超时上下文, Handler 需要使用 <-ctx.UserContext().Done

func WithTimeoutDefault

func WithTimeoutDefault(timeoutErrors ...error) fiber.Handler

Types

type LogCondition

type LogCondition func(c *fiber.Ctx, elapsed time.Duration) bool

LogCondition 日志记录条件计算器

Jump to

Keyboard shortcuts

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