Documentation
¶
Overview ¶
Package httpresp renders framework-specific HTTP error responses.
Index ¶
- func APIError(c *echo.Context, err error) error
- func Created(c *echo.Context, data interface{}) error
- func List(c *echo.Context, data interface{}, page PageMeta) error
- func OK(c *echo.Context, data interface{}) error
- func RequestID(c *echo.Context) string
- func Status(kind apperr.Kind) int
- type ErrorResponse
- type ListResponse
- type PageMeta
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct {
Code int `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
Timestamp int64 `json:"timestamp"`
}
ErrorResponse is the standard JSON error response for HTTP adapters.
type ListResponse ¶
type ListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
Page PageMeta `json:"page"`
RequestID string `json:"request_id"`
Timestamp int64 `json:"timestamp"`
}
ListResponse is the standard JSON list response for HTTP adapters.
Click to show internal directories.
Click to hide internal directories.