ginx

package module
v0.0.0-...-b4640bc Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIHandler

func APIHandler[TReq, TResp any](handler func(context.Context, *TReq) (TResp, error)) func(*gin.Context)

func APIHandlerWithUriParams

func APIHandlerWithUriParams[TReq, TResp, TUri any](handler func(context.Context, *TReq, *TUri) (TResp, error)) func(*gin.Context)

func LogHook

func LogHook(logger *logrus.Logger, notLogged ...string) gin.HandlerFunc

LogHook creates request logging middleware with exact paths excluded.

func LogHookWithConfig

func LogHookWithConfig(logger *logrus.Logger, config LogHookConfig) gin.HandlerFunc

LogHookWithConfig creates request logging middleware with configurable exclusions. SkipFunc runs after the remaining handlers have completed.

func RESTHandler

func RESTHandler[TReq, TResp any](handler func(context.Context, *TReq) (TResp, error)) func(*gin.Context)

func RESTHandlerWithUriParams

func RESTHandlerWithUriParams[TReq, TResp, TUri any](handler func(context.Context, *TReq, *TUri) (TResp, error)) func(*gin.Context)

func RequestID

func RequestID() gin.HandlerFunc

func Serve

func Serve(app *gin.Engine, addr string) error

func ServeWithTimeout

func ServeWithTimeout(app *gin.Engine, addr string, timeout time.Duration) error

Types

type APIError

type APIError struct {
	Error     string `json:"error"`
	RequestID string `json:"request_id"`
}

type APIResponse

type APIResponse struct {
	Success   bool   `json:"success"`
	Data      any    `json:"data"`
	Error     string `json:"error,omitempty"`
	RequestID string `json:"request_id,omitempty"`
}

type Empty

type Empty struct {
}

type LogHookConfig

type LogHookConfig struct {
	SkipPaths []string
	SkipFunc  gin.Skipper
}

LogHookConfig configures request logging exclusions.

type Normalizer

type Normalizer interface {
	Normalize() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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