cMiddleware

package module
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &MiddlewareComponent{}

Functions

func GetGinHandlerFunc

func GetGinHandlerFunc(app, name string, params MiddlewareParams) (gin.HandlerFunc, error)

func SetErrorHandler added in v0.4.1

func SetErrorHandler(f func(ctx *gin.Context, err error))

Types

type MiddlewareComponent added in v0.3.2

type MiddlewareComponent struct{}

func (*MiddlewareComponent) Inject added in v0.3.2

func (i *MiddlewareComponent) Inject(instance any) bool

func (*MiddlewareComponent) InjectConf added in v0.4.0

func (i *MiddlewareComponent) InjectConf(config cComponents.ConfigInterface) bool

func (*MiddlewareComponent) Listen added in v0.4.0

func (*MiddlewareComponent) Load added in v0.3.2

func (i *MiddlewareComponent) Load()

type MiddlewareContainer

type MiddlewareContainer struct {
	// contains filtered or unexported fields
}

func (*MiddlewareContainer) Get

func (i *MiddlewareContainer) Get(name string) any

func (*MiddlewareContainer) Is added in v0.4.0

func (i *MiddlewareContainer) Is(instance any) bool

func (*MiddlewareContainer) Range added in v0.4.0

func (i *MiddlewareContainer) Range(f func(instance any))

func (*MiddlewareContainer) Remove added in v0.4.0

func (i *MiddlewareContainer) Remove(name string) bool

func (*MiddlewareContainer) Save

func (i *MiddlewareContainer) Save(instance any) bool

func (*MiddlewareContainer) SetErrorHandler added in v0.4.1

func (i *MiddlewareContainer) SetErrorHandler(f func(ctx *gin.Context, err error))

type MiddlewareInterface

type MiddlewareInterface interface {
	MiddlewareName() (app, name string)
	Handler(ctx *gin.Context, params MiddlewareParams) (err error)
}

type MiddlewareParams added in v0.4.4

type MiddlewareParams map[string]any

func (MiddlewareParams) Get added in v0.4.4

func (i MiddlewareParams) Get(key string, defaultValue any) any

func (MiddlewareParams) GetBool added in v0.4.4

func (i MiddlewareParams) GetBool(key string, defaultValue bool) bool

func (MiddlewareParams) GetFloat64 added in v0.4.4

func (i MiddlewareParams) GetFloat64(key string, defaultValue float64) float64

func (MiddlewareParams) GetInt added in v0.4.4

func (i MiddlewareParams) GetInt(key string, defaultValue int) int

func (MiddlewareParams) GetInt64 added in v0.4.4

func (i MiddlewareParams) GetInt64(key string, defaultValue int64) int64

func (MiddlewareParams) GetString added in v0.4.4

func (i MiddlewareParams) GetString(key string, defaultValue string) string

Jump to

Keyboard shortcuts

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