Skip to content

Commit

Permalink
feat: kv_store batch API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed May 10, 2023
1 parent 33cc4e3 commit 1dc440a
Show file tree
Hide file tree
Showing 11 changed files with 374 additions and 194 deletions.
39 changes: 39 additions & 0 deletions fastly/fixtures/kv_store/batch-create-keys.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
version: 1
interactions:
- request:
body: |-
{"key":"batch-1","value":"VkFMVUU="}
{"key":"batch-2","value":"VkFMVUU="}
form: {}
headers:
Content-Type:
- application/x-ndjson
User-Agent:
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/batch
method: PUT
response:
body: ""
headers:
Accept-Ranges:
- bytes
Content-Length:
- "0"
Date:
- Wed, 10 May 2023 12:12:21 GMT
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-lhr7365-LHR, cache-lhr7365-LHR
X-Timer:
- S1683720741.930472,VS0,VE246
status: 200 OK
code: 200
duration: ""
155 changes: 105 additions & 50 deletions fastly/fixtures/kv_store/check-keys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,45 @@ interactions:
form: {}
headers:
User-Agent:
- FastlyGo/6.5.0 (+github.com/fastly/go-fastly; go1.19)
url: https://api.fastly.com/resources/stores/kv/fff9gl14gebt6m9kkp54ve/keys/apple
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/keys/apple
method: GET
response:
body: apple0
headers:
Accept-Ranges:
- bytes
Cache-Control:
- max-age=86400
Content-Length:
- "6"
Content-Type:
- application/octet-stream
Date:
- Thu, 15 Sep 2022 17:55:38 GMT
Server-Timing:
- get_object;dur=119, total;dur=123, verify;dur=1
- Wed, 10 May 2023 12:12:19 GMT
Generation:
- "1683720737565195"
Last-Modified:
- Wed, 10 May 2023 12:12:17 GMT
Metadata:
- ""
Server-Timing-Get-Key:
- transaction_lookup_ok;dur=0, lookup_handle_status_status_fetch;dur=1, backend_request;dur=473,
res_ok;dur=0, finish_write;dur=1, cache_handle_status_FOUND___USABLE;dur=0,
cache_handle_status_USABLE;dur=0, handle_usable;dur=0, lookup_handle_get_body;dur=0,
user_metadata_json;dur=0, total;dur=476
Stored-Content-Length:
- "6"
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
- MISS, MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-fty21321-FTY, cache-sea4451-SEA
- cache-lhr7367-LHR, cache-lhr7365-LHR
X-Timer:
- S1663264538.181432,VS0,VE183
- S1683720739.562212,VS0,VE493
status: 200 OK
code: 200
duration: ""
Expand All @@ -42,34 +53,45 @@ interactions:
form: {}
headers:
User-Agent:
- FastlyGo/6.5.0 (+github.com/fastly/go-fastly; go1.19)
url: https://api.fastly.com/resources/stores/kv/fff9gl14gebt6m9kkp54ve/keys/banana
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/keys/banana
method: GET
response:
body: banana1
headers:
Accept-Ranges:
- bytes
Cache-Control:
- max-age=86400
Content-Length:
- "7"
Content-Type:
- application/octet-stream
Date:
- Thu, 15 Sep 2022 17:55:38 GMT
Server-Timing:
- get_object;dur=95, total;dur=99, verify;dur=1
- Wed, 10 May 2023 12:12:19 GMT
Generation:
- "1683720737774725"
Last-Modified:
- Wed, 10 May 2023 12:12:17 GMT
Metadata:
- ""
Server-Timing-Get-Key:
- transaction_lookup_ok;dur=0, lookup_handle_status_status_fetch;dur=1, backend_request;dur=430,
res_ok;dur=0, finish_write;dur=1, cache_handle_status_FOUND___USABLE;dur=0,
cache_handle_status_USABLE;dur=0, handle_usable;dur=0, lookup_handle_get_body;dur=0,
user_metadata_json;dur=0, total;dur=433
Stored-Content-Length:
- "7"
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
- MISS, MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-fty21353-FTY, cache-sea4451-SEA
- cache-lhr7351-LHR, cache-lhr7365-LHR
X-Timer:
- S1663264538.383885,VS0,VE160
- S1683720739.111105,VS0,VE474
status: 200 OK
code: 200
duration: ""
Expand All @@ -78,34 +100,45 @@ interactions:
form: {}
headers:
User-Agent:
- FastlyGo/6.5.0 (+github.com/fastly/go-fastly; go1.19)
url: https://api.fastly.com/resources/stores/kv/fff9gl14gebt6m9kkp54ve/keys/carrot
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/keys/carrot
method: GET
response:
body: carrot2
headers:
Accept-Ranges:
- bytes
Cache-Control:
- max-age=86400
Content-Length:
- "7"
Content-Type:
- application/octet-stream
Date:
- Thu, 15 Sep 2022 17:55:38 GMT
Server-Timing:
- get_object;dur=97, verify;dur=1, total;dur=102
- Wed, 10 May 2023 12:12:20 GMT
Generation:
- "1683720737987074"
Last-Modified:
- Wed, 10 May 2023 12:12:17 GMT
Metadata:
- ""
Server-Timing-Get-Key:
- transaction_lookup_ok;dur=0, lookup_handle_status_status_fetch;dur=1, backend_request;dur=370,
res_ok;dur=0, finish_write;dur=1, cache_handle_status_FOUND___USABLE;dur=0,
cache_handle_status_USABLE;dur=0, handle_usable;dur=0, lookup_handle_get_body;dur=0,
user_metadata_json;dur=0, total;dur=373
Stored-Content-Length:
- "7"
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
- MISS, MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-fty21337-FTY, cache-sea4451-SEA
- cache-lhr7335-LHR, cache-lhr7365-LHR
X-Timer:
- S1663264539.560918,VS0,VE166
- S1683720740.614086,VS0,VE392
status: 200 OK
code: 200
duration: ""
Expand All @@ -114,34 +147,45 @@ interactions:
form: {}
headers:
User-Agent:
- FastlyGo/6.5.0 (+github.com/fastly/go-fastly; go1.19)
url: https://api.fastly.com/resources/stores/kv/fff9gl14gebt6m9kkp54ve/keys/dragonfruit
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/keys/dragonfruit
method: GET
response:
body: dragonfruit3
headers:
Accept-Ranges:
- bytes
Cache-Control:
- max-age=86400
Content-Length:
- "12"
Content-Type:
- application/octet-stream
Date:
- Thu, 15 Sep 2022 17:55:38 GMT
Server-Timing:
- get_object;dur=121, total;dur=125, verify;dur=1
- Wed, 10 May 2023 12:12:20 GMT
Generation:
- "1683720738237014"
Last-Modified:
- Wed, 10 May 2023 12:12:18 GMT
Metadata:
- ""
Server-Timing-Get-Key:
- transaction_lookup_ok;dur=0, lookup_handle_status_status_fetch;dur=1, backend_request;dur=462,
res_ok;dur=0, finish_write;dur=4, cache_handle_status_FOUND___USABLE;dur=0,
cache_handle_status_USABLE;dur=0, handle_usable;dur=0, lookup_handle_get_body;dur=0,
user_metadata_json;dur=0, total;dur=468
Stored-Content-Length:
- "12"
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
- MISS, MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-fty21362-FTY, cache-sea4451-SEA
- cache-lhr7338-LHR, cache-lhr7365-LHR
X-Timer:
- S1663264539.742169,VS0,VE185
- S1683720740.035630,VS0,VE481
status: 200 OK
code: 200
duration: ""
Expand All @@ -150,34 +194,45 @@ interactions:
form: {}
headers:
User-Agent:
- FastlyGo/6.5.0 (+github.com/fastly/go-fastly; go1.19)
url: https://api.fastly.com/resources/stores/kv/fff9gl14gebt6m9kkp54ve/keys/eggplant
- FastlyGo/8.0.3 (+github.com/fastly/go-fastly; go1.18.5)
url: https://api.fastly.com/resources/stores/kv/yvineawuxczxih2d54jsje/keys/eggplant
method: GET
response:
body: eggplant4
headers:
Accept-Ranges:
- bytes
Cache-Control:
- max-age=86400
Content-Length:
- "9"
Content-Type:
- application/octet-stream
Date:
- Thu, 15 Sep 2022 17:55:39 GMT
Server-Timing:
- total;dur=121, verify;dur=1, get_object;dur=115
- Wed, 10 May 2023 12:12:20 GMT
Generation:
- "1683720738460728"
Last-Modified:
- Wed, 10 May 2023 12:12:18 GMT
Metadata:
- ""
Server-Timing-Get-Key:
- transaction_lookup_ok;dur=0, lookup_handle_status_status_fetch;dur=0, backend_request;dur=343,
res_ok;dur=0, finish_write;dur=1, cache_handle_status_FOUND___USABLE;dur=0,
cache_handle_status_USABLE;dur=0, handle_usable;dur=0, lookup_handle_get_body;dur=0,
user_metadata_json;dur=0, total;dur=346
Stored-Content-Length:
- "9"
Strict-Transport-Security:
- max-age=31536000
Via:
- 1.1 varnish
X-Cache:
- MISS
- MISS, MISS
X-Cache-Hits:
- "0"
X-Served-By:
- cache-fty21342-FTY, cache-sea4451-SEA
- cache-lhr7326-LHR, cache-lhr7365-LHR
X-Timer:
- S1663264539.945095,VS0,VE182
- S1683720741.543073,VS0,VE359
status: 200 OK
code: 200
duration: ""
Loading

0 comments on commit 1dc440a

Please sign in to comment.