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 DeletedIDs(c *echo.Context, ids []int64) error
- func OK(c *echo.Context, data interface{}) error
- func Paginated(c *echo.Context, data interface{}, page, pageSize, total int) error
- func RequestID(c *echo.Context) string
- type ErrorResponse
- type ListResponse
- type PageMeta
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeletedIDs ¶
DeletedIDs renders a successful batch-delete response echoing the IDs.
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.