httpcontext

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSessionContext

func SetSessionContext(c *echo.Context, info SessionInfo)

SetSessionContext stores session info in the Echo context for downstream handlers.

Types

type ContextMeta

type ContextMeta struct{}

ContextMeta stores and reads response metadata from Echo context.

func (ContextMeta) GetError

func (ContextMeta) GetError(c *echo.Context) error

func (ContextMeta) GetErrorDetails

func (ContextMeta) GetErrorDetails(c *echo.Context) Details

func (ContextMeta) GetTransportError

func (ContextMeta) GetTransportError(c *echo.Context) (string, string)

func (ContextMeta) SetError

func (ContextMeta) SetError(c *echo.Context, err error)

func (ContextMeta) SetErrorDetails

func (ContextMeta) SetErrorDetails(c *echo.Context, details Details)

func (ContextMeta) SetTransportError

func (ContextMeta) SetTransportError(c *echo.Context, code string, message string)

type Details

type Details map[string]any

func (Details) String

func (d Details) String() string

type Meta

type Meta interface {
	GetError(c *echo.Context) error
	GetErrorDetails(c *echo.Context) Details
	GetTransportError(c *echo.Context) (code string, message string)
	SetError(c *echo.Context, err error)
	SetErrorDetails(c *echo.Context, details Details)
	SetTransportError(c *echo.Context, code string, message string)
}

Meta defines transport response metadata access for HTTP components.

func NewContextMeta

func NewContextMeta() Meta

NewContextMeta creates a Meta backed by Echo request context.

type SessionInfo

type SessionInfo struct {
	UserID int64
	Email  string
	Method auth.MethodType
}

SessionInfo holds session data stored in the request context by the session middleware.

func SessionFromContext

func SessionFromContext(c *echo.Context) (SessionInfo, bool)

SessionFromContext retrieves the session info stored by the session middleware.

Jump to

Keyboard shortcuts

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