ginmiddleware

package
v0.8.28 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureResponseBody

func CaptureResponseBody(c *gin.Context, passThrough bool) (*bytes.Buffer, gin.ResponseWriter)

func Client

func Client(c *gin.Context, name string) ent.EntClient

func DefaultOASErrorHandler

func DefaultOASErrorHandler(c *gin.Context, err error)

func Transaction

func Transaction(c *gin.Context, name string) ent.EntTx

func UpgradingHandler

func UpgradingHandler(checker func(*gin.Context) WSHandler) gin.HandlerFunc

func WithEntClient

func WithEntClient(client ent.EntClient, name string) gin.HandlerFunc

func WithOASValidation

func WithOASValidation(
	spec *openapi3.T,
	validateResponse bool,
	errorHandler OASErrorHandler,
	options *openapi3filter.Options,
) gin.HandlerFunc

func WithTransaction

func WithTransaction(
	name string,
	opts *sql.TxOptions,
	controls ...TransactionControl,
) gin.HandlerFunc

Types

type OASErrorHandler

type OASErrorHandler func(c *gin.Context, err error)

func AllowUndefinedRoutes

func AllowUndefinedRoutes(handler OASErrorHandler) OASErrorHandler

type TransactionControl

type TransactionControl func(*gin.Context, *sql.TxOptions) bool

type WSHandler

type WSHandler interface {
	Upgrader() *websocket.Upgrader
	Handle(*gin.Context, *websocket.Conn)
}

Jump to

Keyboard shortcuts

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