KeyValueService abstracts the storage and retrieval of json-compatable values and provides management and expiration of those values. All methods are asynchronous.
KeyValueService
const store: KeyValueService
checkHealth is for asserting that the store's connection is healthy, it should reject if it is not healthy.
checkHealth
close disconnects the store from whatever it is backed by.
close
await store.close()
delete removes a value under a specific key.
delete
await store.delete('puppy_list')
put adds a value to the store.
put
await store.put('puppy_list', [{ name: 'Sandie' }])
retrieve gets a value out of the store for you and allows you to cast it's type.
retrieve
interface Puppy { name: string}const value = await store.retrieve<Puppy[]>('puppy_list')
setExpiry triggers the value under that key is removed in a certain amount of seconds.
setExpiry
const oneMinute = 60await store.setExpiry('puppy_list', oneMinute)
Generated using TypeDoc
KeyValueService
abstracts the storage and retrieval of json-compatable values and provides management and expiration of those values. All methods are asynchronous.