Documentation
¶
Index ¶
- func SetSessionContext(c *echo.Context, info SessionInfo)
- type ContextMeta
- func (ContextMeta) GetError(c *echo.Context) error
- func (ContextMeta) GetErrorDetails(c *echo.Context) Details
- func (ContextMeta) GetTransportError(c *echo.Context) (string, string)
- func (ContextMeta) SetError(c *echo.Context, err error)
- func (ContextMeta) SetErrorDetails(c *echo.Context, details Details)
- func (ContextMeta) SetTransportError(c *echo.Context, code string, message string)
- type Details
- type Meta
- type SessionInfo
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) GetErrorDetails ¶
func (ContextMeta) GetErrorDetails(c *echo.Context) Details
func (ContextMeta) GetTransportError ¶
func (ContextMeta) GetTransportError(c *echo.Context) (string, string)
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 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.
Click to show internal directories.
Click to hide internal directories.