Add a count to the servers response

This commit is contained in:
Avinash Sridhar 2025-04-23 22:21:40 -04:00
commit 0d9ff1fcb1
No known key found for this signature in database

View file

@ -20,6 +20,8 @@ type PaginatedResponse struct {
// Metadata contains pagination metadata
type Metadata struct {
NextCursor string `json:"next_cursor,omitempty"`
Count int `json:"count,omitempty"`
Total int `json:"total,omitempty"`
}
// ServersHandler returns a handler for listing registry items
@ -82,6 +84,7 @@ func ServersHandler(registry service.RegistryService) http.HandlerFunc {
if nextCursor != "" {
response.Metadata = Metadata{
NextCursor: nextCursor,
Count: len(registries),
}
}