Documentation ¶
Index ¶
- func GenerateErrorResponse(c echo.Context, data interface{}, message string) error
- func GenerateForbiddenResponse(c echo.Context, data interface{}, message string) error
- func GenerateSuccessResponse(c echo.Context, data interface{}, metadata *MetaData, message string) error
- func GenerateUnauthorizedResponse(c echo.Context, data interface{}, message string) error
- type MetaData
- type ResponseDTO
- type ResponseDTOWithPagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateErrorResponse ¶
GenerateErrorResponse Http error response
func GenerateForbiddenResponse ¶
GenerateForbiddenResponse Http forbidden response
func GenerateSuccessResponse ¶
func GenerateSuccessResponse(c echo.Context, data interface{}, metadata *MetaData, message string) error
GenerateSuccessResponse Http success response
func GenerateUnauthorizedResponse ¶
GenerateUnauthorizedResponse Http unauthorized response
Types ¶
type MetaData ¶
type MetaData struct { Page int64 `json:"page"` PerPage int64 `json:"per_page"` PageCount int64 `json:"page_count"` TotalCount int64 `json:"total_count"` Links []map[string]string `json:"links"` }
MetaData Http response metadata
func GetPaginationMetadata ¶
GetPaginationMetadata return pagination metadata
type ResponseDTO ¶
type ResponseDTO struct { Data interface{} `json:"data" msgpack:"data" xml:"data"` Status string `json:"status" msgpack:"status" xml:"status"` Message string `json:"message" msgpack:"message" xml:"message"` }
ResponseDTO Http response dto
type ResponseDTOWithPagination ¶
type ResponseDTOWithPagination struct { Metadata *MetaData `json:"_metadata"` Data interface{} `json:"data" msgpack:"data" xml:"data"` Status string `json:"status" msgpack:"status" xml:"status"` Message string `json:"message" msgpack:"message" xml:"message"` }
ResponseDTOWithPagination Http response dto with pagination
Click to show internal directories.
Click to hide internal directories.