API Design
We will use REST API as our interface. This gives us flexibility to define our TTL semantics.
- GET - /getValue?key=""
- response: {value="",expires_at="",version=""}
- POST - /putValue
- request: {key="",value="",ttl="",if_version:""} -> if ttl is set as the configuration for the expiry and eviction.
- response: {value="",putStatus = boolean}
- DELETE -/deleteKey
- request:{key=""}
- response:{status: boolean}
- For admins - POST - /setEvictionConfiguration:
- request:{config = "LRU/TTL"}
- response:{status: boolean}