Documentation ¶
Index ¶
- func InArray[T comparable](needle T, haystack []T) bool
- func NewHTTPRespond(context *gin.Context, code int, data interface{}, args ...any)
- func ParseParam(ctx *gin.Context, filterBetween bool) ([]int, []string)
- type ErrorRespond
- type Paging
- type ServiceError
- type SuccessRespond
- type SuccessRespondWithPagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InArray ¶
func InArray[T comparable](needle T, haystack []T) bool
func NewHTTPRespond ¶
Types ¶
type ErrorRespond ¶
type ErrorRespond struct { Code int `json:"code"` Status string `json:"status"` Data string `json:"data"` }
ErrorRespond message
type ServiceError ¶
func ValidateDataRow ¶
func ValidateDataRow[T any](data *T, err error) (valueData *T, errData *ServiceError)
func ValidateDataRows ¶
func ValidateDataRows[T any](data []*T, err error) (valueData []*T, errData *ServiceError)
func ValidatePrimitiveValue ¶
func ValidatePrimitiveValue[T any](data T, err error) (valueData T, errData *ServiceError)
type SuccessRespond ¶
type SuccessRespond struct { Code int `json:"code"` Status string `json:"status"` Data any `json:"data"` }
SuccessRespond message
type SuccessRespondWithPagination ¶
type SuccessRespondWithPagination struct { Code int `json:"code"` Status string `json:"status"` Count int `json:"total_data"` Total int `json:"total_page"` Current int `json:"current_page"` Next Paging `json:"next"` Previous Paging `json:"previous"` Data any `json:"data"` }
SuccessRespondWithPagination message
Click to show internal directories.
Click to hide internal directories.