From 0d9ff1fcb13e937d5bcfd9f7df6091bce01bdde2 Mon Sep 17 00:00:00 2001 From: Avinash Sridhar Date: Wed, 23 Apr 2025 22:21:40 -0400 Subject: [PATCH] Add a count to the servers response --- internal/api/handlers/v0/servers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/api/handlers/v0/servers.go b/internal/api/handlers/v0/servers.go index 4d59786..21df67c 100644 --- a/internal/api/handlers/v0/servers.go +++ b/internal/api/handlers/v0/servers.go @@ -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), } }