middleware

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheWithRevalidation

func CacheWithRevalidation(next echo.HandlerFunc) echo.HandlerFunc

func JWTMiddleware

func JWTMiddleware(cfg config.Config) echo.MiddlewareFunc

Middleware function to validate JWT token

func LoggingMiddleware

func LoggingMiddleware(logger *zerolog.Logger) echo.MiddlewareFunc

func NewEchoServer

func NewEchoServer(cfg config.Config) *echo.Echo

NewEchoServer creates and configures a new Echo server instance. Parameters:

  • cfg: The application configuration.

Returns:

  • *echo.Echo: A configured Echo server instance.

Types

type CustomValidator

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

func (*CustomValidator) Validate

func (v *CustomValidator) Validate(i interface{}) error

type Data

type Data struct {
	UserID int64  `json:"user_id"`
	Email  string `json:"email"`
}

type PayloadToken

type PayloadToken struct {
	Data *Data `json:"data"`
	jwt.StandardClaims
}

func NewTokenInformation

func NewTokenInformation(ctx echo.Context) (*PayloadToken, error)

Jump to

Keyboard shortcuts

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