Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiResponse ¶
type ApiResponse[T any] struct { Success bool `json:"success" doc:"Whether the request was successful"` Data T `json:"data" doc:"Response data"` }
ApiResponse is a generic wrapper for API responses.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error" doc:"Error message describing what went wrong"`
}
ErrorResponse represents an error response.
type JsonObject ¶
type JsonObject map[string]interface{}
JsonObject is a map-based representation of a JSON object that can be stored in a database. It implements the sql.Valuer and sql.Scanner interfaces for seamless database integration.
nolint:recvcheck
func (*JsonObject) Scan ¶
func (j *JsonObject) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database retrieval. It unmarshals JSON data from the database into the JsonObject. Supports scanning from []byte or string values. If the value is nil, the JsonObject is set to nil.
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message" doc:"Response message"`
}
MessageResponse represents a simple message response.
type Paginated ¶
type Paginated[T any] struct { Success bool `json:"success" doc:"Whether the request was successful"` Data []T `json:"data" doc:"Array of items for the current page"` Pagination PaginationResponse `json:"pagination" doc:"Pagination metadata"` }
Paginated is a generic wrapper for paginated responses.
type PaginationResponse ¶
type PaginationResponse struct {
TotalPages int64 `json:"totalPages" doc:"Total number of pages"`
TotalItems int64 `json:"totalItems" doc:"Total number of items in the current filtered set"`
CurrentPage int `json:"currentPage" doc:"Current page number (1-indexed)"`
ItemsPerPage int `json:"itemsPerPage" doc:"Number of items per page"`
GrandTotalItems int64 `json:"grandTotalItems,omitempty" doc:"Total number of items without filters"`
}
PaginationResponse contains pagination metadata.