gacache

Package Version Hex Docs

gleam add gacache@1
import gacache
import gleam/io

pub fn main() {
  // Start a cache
  let assert Ok(cache) = gacache.start() // Starts the cache
  gacache.set(cache, "test", "val") // Set a value
  gacache.set(cache, "funky", "1") // Set a value
  let _ = io.debug(gacache.get(cache, "test"))// Ok("val") | The value bound to the key
  io.debug(gacache.keys(cache)) // ["funky", "test"] | All keys in the map
  gacache.stop(cache) // Stops the cache
}

Further documentation can be found at https://hexdocs.pm/gacache.

Search Document