View Source Neuron.Store (neuron v5.1.0)

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

@spec current_context(key :: atom()) :: :global | :process

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

examples

Examples

iex> Neuron.Store.current_context(:my_key)
:global
@spec delete(key :: atom()) :: any()

deletes neuron application/process environmental variables

examples

Examples

iex> Neuron.Store.delete(:my_key)
:ok
@spec delete(context :: :global | :process, key :: atom()) :: :ok
@spec get(key :: atom()) :: any()

returns neuron application/process environmental variables

examples

Examples

iex> Neuron.Store.set(:my_key, "value")
:ok
iex> Neuron.Store.get(:my_key)
"value"
@spec get(context :: :global | :process, key :: atom()) :: any()
@spec get(context :: :global | :process, key :: atom(), default :: any()) :: any()
@spec set(key :: atom(), value :: any()) :: :ok

sets neuron application/process environmental variables

examples

Examples

iex> Neuron.Store.set(:my_key, "value")
:ok
@spec set(context :: :global | :process, key :: atom(), value :: any()) :: :ok