middleware

package
v0.0.0-...-19b67c5 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCtxLoggers

func AddCtxLoggers(logger *zap.Logger) gin.HandlerFunc

AddCtxLoggers middleware makes the logger available to handlers.

Both sugared and non-sugared versions are available.

func CreateCoreEngine

func CreateCoreEngine(logger *zap.Logger) *gin.Engine

CreateCoreEngine returns a gin router with zap logging and recovery

func CreateTestContext

func CreateTestContext() (*gin.Context, *gin.Engine)

CreateTestContext returns a gin Context and engine for testing.

Unlike a raw Gin-prepared test context, this one has a request.

func CtxLog

func CtxLog(ctx *gin.Context) *zap.Logger

func CtxLogS

func CtxLogS(ctx *gin.Context) *zap.SugaredLogger

Types

type StatMap

type StatMap string

func (StatMap) FetchAll

func (s StatMap) FetchAll() (map[string]any, error)

func (StatMap) Int64

func (s StatMap) Int64(name string) (int64, error)

func (StatMap) MapInt64

func (s StatMap) MapInt64(name string) (map[string]int64, error)

func (StatMap) SetInt64

func (s StatMap) SetInt64(name string, val int64) error

func (StatMap) SetMapInt64

func (s StatMap) SetMapInt64(name string, val map[string]int64) error

func (StatMap) StorageId

func (s StatMap) StorageId() string

func (StatMap) StoragePrefix

func (s StatMap) StoragePrefix() string

Jump to

Keyboard shortcuts

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