 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func ClearUserContext(c echo.Context)
- func GetCorrelationID(ctx context.Context) string
- func GetEmail(c echo.Context) (string, bool)
- func GetLogger(ctx context.Context) logging.Logger
- func GetRequestID(ctx context.Context) string
- func GetRole(c echo.Context) (string, bool)
- func GetUserID(c echo.Context) (string, bool)
- func IsAdmin(c echo.Context) bool
- func IsAuthenticated(c echo.Context) bool
- func SetEmail(c echo.Context, email string)
- func SetRole(c echo.Context, role string)
- func SetUserID(c echo.Context, userID string)
- type Key
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearUserContext ¶
func ClearUserContext(c echo.Context)
ClearUserContext clears all user-related data from context
func GetCorrelationID ¶
GetCorrelationID retrieves the correlation ID from context
func GetRequestID ¶
GetRequestID retrieves the request ID from context
func IsAuthenticated ¶
func IsAuthenticated(c echo.Context) bool
IsAuthenticated checks if the user is authenticated
Types ¶
type Key ¶
type Key string
Key represents a key in the context
const ( // Request context keys RequestIDHeader = "X-Trace-Id" RequestTimeout = 30 * time.Second // Context keys RequestIDKey Key = "request_id" CorrelationIDKey Key = "correlation_id" LoggerKey Key = "logger" UserIDKey Key = "user_id" EmailKey Key = "email" RoleKey Key = "role" SessionKey Key = "session" )
type Middleware ¶
type Middleware struct {
	// contains filtered or unexported fields
}
    Middleware provides context handling for HTTP requests
func NewMiddleware ¶
func NewMiddleware(logger logging.Logger) *Middleware
NewMiddleware creates a new context middleware
func (*Middleware) WithContext ¶
func (m *Middleware) WithContext() echo.MiddlewareFunc
WithContext adds context to the request
 Click to show internal directories. 
   Click to hide internal directories.