neuron v4.0.0 Neuron.Store View Source

This module provides a simple way to interface with the process and application environmental variables, acting as a simple KV store.

WARNING: this module is not intended to be used outside of this library.

Link to this section Summary

Functions

gets the context of a given neuron application/process environmental variable

deletes neuron application/process environmental variables

returns neuron application/process environmental variables

sets neuron application/process environmental variables

Link to this section Functions

Link to this function

current_context(key)

View Source
current_context(key :: atom()) :: :global | :process

gets the context of a given neuron application/process environmental variable

Examples

iex> Neuron.Store.current_context(:my_key)
:global
Link to this function

delete(key)

View Source
delete(key :: atom()) :: any()

deletes neuron application/process environmental variables

Examples

iex> Neuron.Store.delete(:my_key)
:ok
Link to this function

delete(atom, key)

View Source
delete(context :: :global | :process, key :: atom()) :: :ok
Link to this function

get(key)

View Source
get(key :: atom()) :: any()

returns neuron application/process environmental variables

Examples

iex> Neuron.Store.set(:my_key, "value")
:ok
iex> Neuron.Store.get(:my_key)
"value"
Link to this function

get(context, key)

View Source
get(context :: :global | :process, key :: atom()) :: any()
Link to this function

get(atom, key, default)

View Source
get(context :: :global | :process, key :: atom(), default :: any()) :: any()
Link to this function

set(key, value)

View Source
set(key :: atom(), value :: any()) :: :ok

sets neuron application/process environmental variables

Examples

iex> Neuron.Store.set(:my_key, "value")
:ok
Link to this function

set(atom, key, value)

View Source
set(context :: :global | :process, key :: atom(), value :: any()) :: :ok