Skip to content
An onetime key-value store for Elixir
Elixir
Latest commit 3218204 Jun 25, 2016 @ryo33 Update timex to 2.2.0
Failed to load latest commit information.
lib Update timex to 2.2.0 Jun 25, 2016
test Update timex to 2.2.0 Jun 25, 2016
.gitignore Implement onetime Dec 24, 2015
.travis.yml Update Feb 22, 2016
LICENSE Initial commit Dec 24, 2015
README.md Update Feb 21, 2016
mix.exs Update timex to 2.2.0 Jun 25, 2016
mix.lock Update timex to 2.2.0 Jun 25, 2016

README.md

Onetime

An onetime key-value store for elixir.
Build Status

Usage

  • Create a store
# Without a name
{:ok, pid} = Onetime.start_link()
# With a name
Onetime.start_link(name: :name)
  • Register a key-value set
    Onetime.register(pid_or_name, "key", "value")
  • Drop the key
    Onetime.register(pid_or_name, "key")
  • Pop the value for a given key
# Normally
Onetime.pop(pid_or_name, "key")
# With seconds of validity
Onetime.pop(pid_or_name, "key", secs)
  • Get the value for a given key and update the key
    Onetime.get_and_update(pid_or_name, "key", "new_key")
  • Get the value for a given key
# Normally
Onetime.get(pid_or_name, "key")
# With seconds of validity
Onetime.get(pid_or_name, "key", secs)
  • Clear old keys and values from store
    Onetime.clear(pid_or_name, secs)
Something went wrong with that request. Please try again.