Documentation ¶
Index ¶
- type MiddlewareManager
- func (mw *MiddlewareManager) AdminMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) AuthJWTMiddleware(authUC auth.UseCase, cfg *config.Config) echo.MiddlewareFunc
- func (mw *MiddlewareManager) AuthSessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) CSRF(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) CheckAuth(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) DebugMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) MetricsMiddleware(metrics metric.Metrics) echo.MiddlewareFunc
- func (mw *MiddlewareManager) OwnerOrAdminMiddleware() echo.MiddlewareFunc
- func (mw *MiddlewareManager) RequestLoggerMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func (mw *MiddlewareManager) RoleBasedAuthMiddleware(roles []string) echo.MiddlewareFunc
- func (mw *MiddlewareManager) Sanitize(next echo.HandlerFunc) echo.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiddlewareManager ¶
type MiddlewareManager struct {
// contains filtered or unexported fields
}
Middleware manager
func NewMiddlewareManager ¶
func NewMiddlewareManager(sessUC session.UCSession, authUC auth.UseCase, cfg *config.Config, origins []string, logger logger.Logger) *MiddlewareManager
Middleware manager constructor
func (*MiddlewareManager) AdminMiddleware ¶
func (mw *MiddlewareManager) AdminMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Admin role
func (*MiddlewareManager) AuthJWTMiddleware ¶
func (mw *MiddlewareManager) AuthJWTMiddleware(authUC auth.UseCase, cfg *config.Config) echo.MiddlewareFunc
JWT way of auth using cookie or Authorization header
func (*MiddlewareManager) AuthSessionMiddleware ¶
func (mw *MiddlewareManager) AuthSessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Auth sessions middleware using redis
func (*MiddlewareManager) CSRF ¶
func (mw *MiddlewareManager) CSRF(next echo.HandlerFunc) echo.HandlerFunc
CSRF Middleware
func (*MiddlewareManager) CheckAuth ¶
func (mw *MiddlewareManager) CheckAuth(next echo.HandlerFunc) echo.HandlerFunc
Check auth middleware
func (*MiddlewareManager) DebugMiddleware ¶
func (mw *MiddlewareManager) DebugMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Debug dump request middleware
func (*MiddlewareManager) MetricsMiddleware ¶
func (mw *MiddlewareManager) MetricsMiddleware(metrics metric.Metrics) echo.MiddlewareFunc
Prometheus metrics middleware
func (*MiddlewareManager) OwnerOrAdminMiddleware ¶
func (mw *MiddlewareManager) OwnerOrAdminMiddleware() echo.MiddlewareFunc
Role based auth middleware, using ctx user
func (*MiddlewareManager) RequestLoggerMiddleware ¶
func (mw *MiddlewareManager) RequestLoggerMiddleware(next echo.HandlerFunc) echo.HandlerFunc
Request logger middleware
func (*MiddlewareManager) RoleBasedAuthMiddleware ¶
func (mw *MiddlewareManager) RoleBasedAuthMiddleware(roles []string) echo.MiddlewareFunc
Role based auth middleware, using ctx user
func (*MiddlewareManager) Sanitize ¶
func (mw *MiddlewareManager) Sanitize(next echo.HandlerFunc) echo.HandlerFunc
Sanitize and read request body to ctx for next use in easy json
Click to show internal directories.
Click to hide internal directories.