Add a count to the servers response
This commit is contained in:
parent
a1c8e6a412
commit
0d9ff1fcb1
1 changed files with 3 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ type PaginatedResponse struct {
|
||||||
// Metadata contains pagination metadata
|
// Metadata contains pagination metadata
|
||||||
type Metadata struct {
|
type Metadata struct {
|
||||||
NextCursor string `json:"next_cursor,omitempty"`
|
NextCursor string `json:"next_cursor,omitempty"`
|
||||||
|
Count int `json:"count,omitempty"`
|
||||||
|
Total int `json:"total,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServersHandler returns a handler for listing registry items
|
// ServersHandler returns a handler for listing registry items
|
||||||
|
|
@ -82,6 +84,7 @@ func ServersHandler(registry service.RegistryService) http.HandlerFunc {
|
||||||
if nextCursor != "" {
|
if nextCursor != "" {
|
||||||
response.Metadata = Metadata{
|
response.Metadata = Metadata{
|
||||||
NextCursor: nextCursor,
|
NextCursor: nextCursor,
|
||||||
|
Count: len(registries),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue