Skip to content

Commit cfbddc6

Browse files
committed
feat: add object active and deleted endpoints
1 parent 9f5d443 commit cfbddc6

File tree

6 files changed

+483
-48
lines changed

6 files changed

+483
-48
lines changed

docs/docs.go

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,116 @@ const docTemplate = `{
9797
}
9898
}
9999
},
100+
"/objects/active": {
101+
"get": {
102+
"description": "Retrieves a paginated list of object IDs that have at least one non-deleted key from the database.",
103+
"consumes": [
104+
"application/json"
105+
],
106+
"produces": [
107+
"application/json"
108+
],
109+
"tags": [
110+
"objects"
111+
],
112+
"summary": "Get Active Object IDs",
113+
"parameters": [
114+
{
115+
"type": "integer",
116+
"description": "Number of items per page (default: 20, max: 1000)",
117+
"name": "limit",
118+
"in": "query"
119+
},
120+
{
121+
"type": "integer",
122+
"description": "Number of items to skip (default: 0)",
123+
"name": "offset",
124+
"in": "query"
125+
}
126+
],
127+
"responses": {
128+
"200": {
129+
"description": "Paginated list of active object IDs",
130+
"schema": {
131+
"$ref": "#/definitions/database.GetAllObjectIDsResult"
132+
}
133+
},
134+
"400": {
135+
"description": "Invalid query parameters",
136+
"schema": {
137+
"type": "object",
138+
"additionalProperties": {
139+
"type": "string"
140+
}
141+
}
142+
},
143+
"500": {
144+
"description": "Internal server error",
145+
"schema": {
146+
"type": "object",
147+
"additionalProperties": {
148+
"type": "string"
149+
}
150+
}
151+
}
152+
}
153+
}
154+
},
155+
"/objects/deleted": {
156+
"get": {
157+
"description": "Retrieves a paginated list of object IDs that have no non-deleted keys from the database.",
158+
"consumes": [
159+
"application/json"
160+
],
161+
"produces": [
162+
"application/json"
163+
],
164+
"tags": [
165+
"objects"
166+
],
167+
"summary": "Get Deleted Object IDs",
168+
"parameters": [
169+
{
170+
"type": "integer",
171+
"description": "Number of items per page (default: 20, max: 1000)",
172+
"name": "limit",
173+
"in": "query"
174+
},
175+
{
176+
"type": "integer",
177+
"description": "Number of items to skip (default: 0)",
178+
"name": "offset",
179+
"in": "query"
180+
}
181+
],
182+
"responses": {
183+
"200": {
184+
"description": "Paginated list of deleted object IDs",
185+
"schema": {
186+
"$ref": "#/definitions/database.GetAllObjectIDsResult"
187+
}
188+
},
189+
"400": {
190+
"description": "Invalid query parameters",
191+
"schema": {
192+
"type": "object",
193+
"additionalProperties": {
194+
"type": "string"
195+
}
196+
}
197+
},
198+
"500": {
199+
"description": "Internal server error",
200+
"schema": {
201+
"type": "object",
202+
"additionalProperties": {
203+
"type": "string"
204+
}
205+
}
206+
}
207+
}
208+
}
209+
},
100210
"/objects/{id}": {
101211
"get": {
102212
"description": "Retrieves an object by its ID from the database with key-value pairs. Optionally specify a timestamp to get historical state.",
@@ -226,9 +336,6 @@ const docTemplate = `{
226336
"database.GetAllObjectIDsResult": {
227337
"type": "object",
228338
"properties": {
229-
"hasMore": {
230-
"type": "boolean"
231-
},
232339
"limit": {
233340
"type": "integer"
234341
},

docs/swagger.json

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,116 @@
9494
}
9595
}
9696
},
97+
"/objects/active": {
98+
"get": {
99+
"description": "Retrieves a paginated list of object IDs that have at least one non-deleted key from the database.",
100+
"consumes": [
101+
"application/json"
102+
],
103+
"produces": [
104+
"application/json"
105+
],
106+
"tags": [
107+
"objects"
108+
],
109+
"summary": "Get Active Object IDs",
110+
"parameters": [
111+
{
112+
"type": "integer",
113+
"description": "Number of items per page (default: 20, max: 1000)",
114+
"name": "limit",
115+
"in": "query"
116+
},
117+
{
118+
"type": "integer",
119+
"description": "Number of items to skip (default: 0)",
120+
"name": "offset",
121+
"in": "query"
122+
}
123+
],
124+
"responses": {
125+
"200": {
126+
"description": "Paginated list of active object IDs",
127+
"schema": {
128+
"$ref": "#/definitions/database.GetAllObjectIDsResult"
129+
}
130+
},
131+
"400": {
132+
"description": "Invalid query parameters",
133+
"schema": {
134+
"type": "object",
135+
"additionalProperties": {
136+
"type": "string"
137+
}
138+
}
139+
},
140+
"500": {
141+
"description": "Internal server error",
142+
"schema": {
143+
"type": "object",
144+
"additionalProperties": {
145+
"type": "string"
146+
}
147+
}
148+
}
149+
}
150+
}
151+
},
152+
"/objects/deleted": {
153+
"get": {
154+
"description": "Retrieves a paginated list of object IDs that have no non-deleted keys from the database.",
155+
"consumes": [
156+
"application/json"
157+
],
158+
"produces": [
159+
"application/json"
160+
],
161+
"tags": [
162+
"objects"
163+
],
164+
"summary": "Get Deleted Object IDs",
165+
"parameters": [
166+
{
167+
"type": "integer",
168+
"description": "Number of items per page (default: 20, max: 1000)",
169+
"name": "limit",
170+
"in": "query"
171+
},
172+
{
173+
"type": "integer",
174+
"description": "Number of items to skip (default: 0)",
175+
"name": "offset",
176+
"in": "query"
177+
}
178+
],
179+
"responses": {
180+
"200": {
181+
"description": "Paginated list of deleted object IDs",
182+
"schema": {
183+
"$ref": "#/definitions/database.GetAllObjectIDsResult"
184+
}
185+
},
186+
"400": {
187+
"description": "Invalid query parameters",
188+
"schema": {
189+
"type": "object",
190+
"additionalProperties": {
191+
"type": "string"
192+
}
193+
}
194+
},
195+
"500": {
196+
"description": "Internal server error",
197+
"schema": {
198+
"type": "object",
199+
"additionalProperties": {
200+
"type": "string"
201+
}
202+
}
203+
}
204+
}
205+
}
206+
},
97207
"/objects/{id}": {
98208
"get": {
99209
"description": "Retrieves an object by its ID from the database with key-value pairs. Optionally specify a timestamp to get historical state.",
@@ -223,9 +333,6 @@
223333
"database.GetAllObjectIDsResult": {
224334
"type": "object",
225335
"properties": {
226-
"hasMore": {
227-
"type": "boolean"
228-
},
229336
"limit": {
230337
"type": "integer"
231338
},

docs/swagger.yaml

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ definitions:
1919
type: object
2020
database.GetAllObjectIDsResult:
2121
properties:
22-
hasMore:
23-
type: boolean
2422
limit:
2523
type: integer
2624
objectIds:
@@ -138,6 +136,80 @@ paths:
138136
summary: Get Object by ID
139137
tags:
140138
- objects
139+
/objects/active:
140+
get:
141+
consumes:
142+
- application/json
143+
description: Retrieves a paginated list of object IDs that have at least one
144+
non-deleted key from the database.
145+
parameters:
146+
- description: 'Number of items per page (default: 20, max: 1000)'
147+
in: query
148+
name: limit
149+
type: integer
150+
- description: 'Number of items to skip (default: 0)'
151+
in: query
152+
name: offset
153+
type: integer
154+
produces:
155+
- application/json
156+
responses:
157+
"200":
158+
description: Paginated list of active object IDs
159+
schema:
160+
$ref: '#/definitions/database.GetAllObjectIDsResult'
161+
"400":
162+
description: Invalid query parameters
163+
schema:
164+
additionalProperties:
165+
type: string
166+
type: object
167+
"500":
168+
description: Internal server error
169+
schema:
170+
additionalProperties:
171+
type: string
172+
type: object
173+
summary: Get Active Object IDs
174+
tags:
175+
- objects
176+
/objects/deleted:
177+
get:
178+
consumes:
179+
- application/json
180+
description: Retrieves a paginated list of object IDs that have no non-deleted
181+
keys from the database.
182+
parameters:
183+
- description: 'Number of items per page (default: 20, max: 1000)'
184+
in: query
185+
name: limit
186+
type: integer
187+
- description: 'Number of items to skip (default: 0)'
188+
in: query
189+
name: offset
190+
type: integer
191+
produces:
192+
- application/json
193+
responses:
194+
"200":
195+
description: Paginated list of deleted object IDs
196+
schema:
197+
$ref: '#/definitions/database.GetAllObjectIDsResult'
198+
"400":
199+
description: Invalid query parameters
200+
schema:
201+
additionalProperties:
202+
type: string
203+
type: object
204+
"500":
205+
description: Internal server error
206+
schema:
207+
additionalProperties:
208+
type: string
209+
type: object
210+
summary: Get Deleted Object IDs
211+
tags:
212+
- objects
141213
/statistics/costs:
142214
get:
143215
consumes:

0 commit comments

Comments
 (0)