middleware

package
v0.13.16 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureResponseBody added in v0.13.0

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

func Client

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

func DefaultOASErrorHandler added in v0.13.0

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

func Transaction

func Transaction(c *gin.Context, name EntKey) *ent.Tx

func WithEntClient added in v0.13.0

func WithEntClient(client *ent.Client, name EntKey) gin.HandlerFunc

func WithOASValidation added in v0.13.0

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

func WithTransaction

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

Types

type EntKey added in v0.13.0

type EntKey string

func Key added in v0.11.0

func Key() EntKey

type OASErrorHandler added in v0.13.0

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

func AllowUndefinedRoutes added in v0.13.0

func AllowUndefinedRoutes(handler OASErrorHandler) OASErrorHandler

type TransactionControl added in v0.13.0

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

Jump to

Keyboard shortcuts

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