Documentation
¶
Index ¶
- func BlacklistChecker(c *fiber.Ctx) bool
- func CacheStats() map[string]any
- func CheckBlacklist(asAPI bool) fiber.Handler
- func CheckPathOr404() fiber.Handler
- func CheckWhitelist(asAPI bool) fiber.Handler
- func CheckWhitelistAnd(checker ForbiddenChecker, asAPI bool) fiber.Handler
- func CheckWhitelistOr(checker ForbiddenChecker, asAPI bool) fiber.Handler
- func CounterStats() map[string]any
- func DefaultLogCondition(c *fiber.Ctx, elapsed time.Duration) bool
- func HTTPCounter(name string) fiber.Handler
- func PurgeBlacklistCache()
- func PurgeWhitelistCache()
- func RecoverLogger() fiber.Handler
- func ResetStatistics()
- func UseBlacklistCache(capacity, lifetime uint32) error
- func UseWhitelistCache(capacity, lifetime uint32) error
- func WebLogger(cond LogCondition) fiber.Handler
- func WhitelistChecker(c *fiber.Ctx) bool
- func WithTimeout(dur time.Duration, timeoutErrors ...error) fiber.Handler
- func WithTimeoutDefault(timeoutErrors ...error) fiber.Handler
- type ForbiddenChecker
- type LogCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlacklistChecker ¶ added in v0.3.2
func BlacklistChecker(c *fiber.Ctx) bool
BlacklistChecker 是否存在于黑名单, true 是黑名单 (黑名单为空时: 放过, false)
func CacheStats ¶ added in v0.3.4
func CheckWhitelistAnd ¶ added in v0.3.2
func CheckWhitelistAnd(checker ForbiddenChecker, asAPI bool) fiber.Handler
CheckWhitelistAnd 同时校验接口白名单和自定义检查器
func CheckWhitelistOr ¶ added in v0.3.2
func CheckWhitelistOr(checker ForbiddenChecker, asAPI bool) fiber.Handler
CheckWhitelistOr 校验接口白名单或自定义检查器
func CounterStats ¶
func DefaultLogCondition ¶
func PurgeBlacklistCache ¶ added in v0.3.4
func PurgeBlacklistCache()
PurgeBlacklistCache 配置项变化时需要清空缓存, 由应用端在 Runtime() 调用
func PurgeWhitelistCache ¶ added in v0.3.4
func PurgeWhitelistCache()
PurgeWhitelistCache 配置项变化时需要清空缓存, 由应用端在 Runtime() 调用
func UseBlacklistCache ¶ added in v0.3.4
UseBlacklistCache 重新设置黑名单检查时缓存, 配置变化时可选再次调用, 由应用端 Start() Runtime() 调用
func UseWhitelistCache ¶ added in v0.3.4
UseWhitelistCache 重新设置白名单检查时缓存, 配置变化时可选再次调用, 由应用端 Start() Runtime() 调用
func WhitelistChecker ¶ added in v0.3.2
func WhitelistChecker(c *fiber.Ctx) bool
WhitelistChecker 是否通过了白名单检查, true 是白名单 (白名单为空时: 通过, true)
func WithTimeout ¶
WithTimeout 附加超时上下文, Handler 需要使用 <-ctx.UserContext().Done
func WithTimeoutDefault ¶
func WithTimeoutDefault(timeoutErrors ...error) fiber.Handler
Types ¶
type ForbiddenChecker ¶ added in v0.3.2
type ForbiddenChecker = func(*fiber.Ctx) bool
type LogCondition ¶
LogCondition 日志记录条件计算器
Click to show internal directories.
Click to hide internal directories.