listResponse wraps data with pagination metadata.
(data any, total, page, limit int)
| 74 | |
| 75 | // listResponse wraps data with pagination metadata. |
| 76 | func listResponse(data any, total, page, limit int) map[string]any { |
| 77 | return map[string]any{ |
| 78 | "data": data, |
| 79 | "meta": map[string]any{ |
| 80 | "total": total, |
| 81 | "page": page, |
| 82 | "limit": limit, |
| 83 | }, |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | // currentPage derives page number from offset and limit. |
| 88 | func currentPage(offset, limit int) int { |
no outgoing calls
no test coverage detected