Documentation ¶
Index ¶
- Variables
- func GetGinHandlerFunc(app, name string, params MiddlewareParams) (gin.HandlerFunc, error)
- func SetErrorHandler(f func(ctx *gin.Context, err error))
- type MiddlewareComponent
- type MiddlewareContainer
- func (i *MiddlewareContainer) Get(name string) any
- func (i *MiddlewareContainer) Is(instance any) bool
- func (i *MiddlewareContainer) Range(f func(instance any))
- func (i *MiddlewareContainer) Remove(name string) bool
- func (i *MiddlewareContainer) Save(instance any) bool
- func (i *MiddlewareContainer) SetErrorHandler(f func(ctx *gin.Context, err error))
- type MiddlewareInterface
- type MiddlewareParams
- func (i MiddlewareParams) Get(key string, defaultValue any) any
- func (i MiddlewareParams) GetBool(key string, defaultValue bool) bool
- func (i MiddlewareParams) GetFloat64(key string, defaultValue float64) float64
- func (i MiddlewareParams) GetInt(key string, defaultValue int) int
- func (i MiddlewareParams) GetInt64(key string, defaultValue int64) int64
- func (i MiddlewareParams) GetString(key string, defaultValue string) string
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
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 (i *MiddlewareComponent) Listen() []*cComponents.ConfigListener
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
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
Click to show internal directories.
Click to hide internal directories.