Documentation ¶
Index ¶
- func BCryptAPIKey(keys map[string]string) echo.MiddlewareFunc
- func BCryptAPIKeyWithConfig(config BCryptAPIKeyConfig) echo.MiddlewareFunc
- func CasbinEnforcer(ce *casbin.Enforcer, g ...func(echo.Context) interface{}) echo.MiddlewareFunc
- func CasbinEnforcerWithConfig(config CasbinEnforcerConfig) echo.MiddlewareFunc
- func Logrus() echo.MiddlewareFunc
- func LogrusBodyLogger(l logrus.FieldLogger) func(c echo.Context, reqB []byte, resB []byte)
- func LogrusWithConfig(config LogrusConfig) echo.MiddlewareFunc
- func OperationResolver(kind string) echo.MiddlewareFunc
- func OperationResolverWithConfig(config OperationResolverConfig) echo.MiddlewareFunc
- func ValueFromContext(key string) func(echo.Context) interface{}
- type BCryptAPIKeyConfig
- type CasbinEnforcerConfig
- type LogrusConfig
- type OperationResolverConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BCryptAPIKey ¶
func BCryptAPIKey(keys map[string]string) echo.MiddlewareFunc
BCryptAPIKey returns a BCryptAPIKey middleware.
func BCryptAPIKeyWithConfig ¶
func BCryptAPIKeyWithConfig(config BCryptAPIKeyConfig) echo.MiddlewareFunc
BCryptAPIKeyWithConfig returns a BCryptAPIKey middleware with config. See `Middleware()`.
func CasbinEnforcer ¶
CasbinEnforcer returns a CasbinEnforcer middleware.
For successful policy evaluation it calls the next handler. For failed evaluation, it sends "403 - Fobidden" response.
func CasbinEnforcerWithConfig ¶
func CasbinEnforcerWithConfig(config CasbinEnforcerConfig) echo.MiddlewareFunc
CasbinEnforcerWithConfig returns a CasbinEnforcer middleware with config. See `Middleware()`.
func Logrus ¶
func Logrus() echo.MiddlewareFunc
func LogrusBodyLogger ¶
func LogrusWithConfig ¶
func LogrusWithConfig(config LogrusConfig) echo.MiddlewareFunc
func OperationResolver ¶
func OperationResolver(kind string) echo.MiddlewareFunc
OperationResolver returns a OperationResolver middleware.
func OperationResolverWithConfig ¶
func OperationResolverWithConfig(config OperationResolverConfig) echo.MiddlewareFunc
OperationResolverWithConfig returns a OperationResolver middleware with config. See `Middleware()`.
func ValueFromContext ¶
ValueFromContext get value from echo.Context
Types ¶
type BCryptAPIKeyConfig ¶
type BCryptAPIKeyConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Keys system - hashed key pairs to check against Keys map[string]string // ClientHeader header that carries system name ClientHeader string // KeyHeader header that carries system key KeyHeader string // ContextKey key to output client if authenticated ContextKey string }
BCryptAPIKeyConfig defines the config for BCryptAPIKey middleware.
type CasbinEnforcerConfig ¶
type CasbinEnforcerConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Enforcer policy engine // Required. Enforcer *casbin.Enforcer // ParamGetters functions to source parameters for Casbin evaluation ParamGetters []func(echo.Context) interface{} }
CasbinEnforcerConfig defines the config for CasbinEnforcer middleware.
type LogrusConfig ¶
type LogrusConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper Logger logrus.FieldLogger }
LogrusConfig defines the config for Logrus middleware.
type OperationResolverConfig ¶
type OperationResolverConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // ContextKey key to output client if authenticated ContextKey string // Kind switches operation resolution logic. Supported: "soap" Kind string }
OperationResolverConfig defines the config for OperationResolver middleware.