RedisService is a KeyValueService that is backed by a redis database.
RedisService
KeyValueService
const store = new RedisService('redis://127.0.0.1')
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
RedisService
is aKeyValueService
that is backed by a redis database.