ginx

package module
v0.0.0-...-446b680 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 12 Imported by: 0

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

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 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