onetime v0.1.2 Onetime

This is a onetime key-value store. This can be used for such as storing tokens for authentication.

Summary

Functions

Remove the old keys and values

Drops the key

Returns the value for a given key

Returns the all keys and values

Returns the value for a given key and changes the key

Checks whether the key exists or not

Returns the value for a given key and removes them

Registers the key

Registers the key with specific time

Types

result :: {:ok, any} | :error

Functions

clear(name, secs)

Specs

clear(any, number) :: map

Remove the old keys and values.

drop(name, key)

Specs

drop(any, any) :: any

Drops the key.

get(name, key, secs \\ :infinity)

Specs

get(any, any, number) :: result

Returns the value for a given key.

get_all(name, secs \\ :infinity)

Specs

get_all(any, number) :: map

Returns the all keys and values.

get_and_update(name, key, new_key, secs \\ :infinity)

Specs

get_and_update(any, any, any, number) :: result

Returns the value for a given key and changes the key.

has?(name, key, secs \\ :infinity)

Specs

has?(any, any, number) :: boolean

Checks whether the key exists or not.

pop(name, key, secs \\ :infinity)

Specs

pop(any, any, number) :: result

Returns the value for a given key and removes them.

register(name, key, value)

Specs

register(any, any, any) :: any

Registers the key.

register(name, key, value, time)

Specs

register(any, any, any, number) :: any

Registers the key with specific time.

start_link(options \\ [])