keystore
gleam add keystore@1
import keystore
pub fn main() {
keystore.new()
// Add a value "bob" under the key "name"
|> keystore.set("name", "bob")
// Give the "name" entry an expiry of 5 seconds
|> keystore.expire("name", 5)
Nil
}
Further documentation can be found at https://hexdocs.pm/keystore.
Future Items
- Encode/Decode options instead of just accepting strings for values
- Alternative mechanism(s) for cleaning expired entries
Development
gleam run # Run the project
gleam test # Run the tests