Skip to content
Snippets Groups Projects

Create SET cache endpoint

Merged Yordan Kinkov requested to merge 3-implement-cache-set-endpoint into main
All threads resolved!
Files
21
+ 29
3
@@ -41,10 +41,10 @@ var _ = Service("cache", func() {
Description("Cache service allows storing and retrieving data from distributed cache.")
Method("Get", func() {
Description("Get value from the cache. The result is a sequence of bytes which the client must decode.")
Description("Get JSON value from the cache.")
Payload(CacheGetRequest)
Result(Bytes)
Result(Any)
HTTP(func() {
GET("/v1/cache")
@@ -59,7 +59,33 @@ var _ = Service("cache", func() {
Example("administration")
})
Response(StatusOK)
Response(StatusOK, func() {
ContentType("application/json")
})
})
})
Method("Set", func() {
Description("Set a JSON value in the cache.")
Payload(CacheSetRequest)
Result(Empty)
HTTP(func() {
POST("/v1/cache")
Header("key:x-cache-key", String, "Cache entry key", func() {
Example("did:web:example.com")
})
Header("namespace:x-cache-namespace", String, "Cache entry namespace", func() {
Example("Login")
})
Header("scope:x-cache-scope", String, "Cache entry scope", func() {
Example("administration")
})
Body("data")
Response(StatusCreated)
})
})
})
Loading