wfiber

package
v0.0.0-...-05fdbbe Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

wfiber is a wrapped fiber

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeLoggerLevel

func ChangeLoggerLevel(hack utility.Hack, wlogger *wlog.Logger) fiber.Handler

func GormTX

func GormTX(db *gorm.DB, skip func(ctx *fiber.Ctx) bool, wlogger *wlog.Logger) fiber.Handler

GormTX

若 skip == nil, 所有條件都會使用 tx 若 skip != nil, 滿足條件的, 將不會啟動 tx

func O11YLogger

func O11YLogger(debug bool, enableTrace bool, wlogger *wlog.Logger) (fiber.Handler, fiber.Handler)

O11YLogger

handler1: logs HTTP messages

handler2: adds a logger with req_id to the standard context, allowing subsequent functions to use logger from ctx

func O11YTrace

func O11YTrace(enableTrace bool) fiber.Handler

func ShowRoutes

func ShowRoutes(router *fiber.App)

Types

type O11YMetric

type O11YMetric struct {
	ResponseSecond   *prometheus.HistogramVec
	RequestsTotal    *prometheus.CounterVec
	RequestsResult   *prometheus.CounterVec
	RequestsInflight *prometheus.GaugeVec
}

func NewO11YMetric

func NewO11YMetric(svcName string) *O11YMetric

func (*O11YMetric) Middleware

func (m *O11YMetric) Middleware(c *fiber.Ctx) error

Jump to

Keyboard shortcuts

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