# `Malla.Config`
[🔗](https://github.com/netkubes/malla/blob/main/lib/malla/config.ex#L21)

A simple ETS-based key-value store for node-wide configuration.

This module provides utilities to store and retrieve data in an ETS table. It is
useful for managing configuration or state that is global to a node and needs to
be accessed from multiple services or processes.

This store is local to each node and is not distributed.

See the [Configuration guide](guides/07-configuration.md) for more details.

# `domain`

```elixir
@type domain() :: term()
```

A way to separate key spaces.

# `add`

```elixir
@spec add(domain(), term(), term()) :: :ok | {:error, term()}
```

Adds a value to a list stored in the store. The value is added only if it is not already present. Operation is serialized.

# `del`

```elixir
@spec del(domain(), term()) :: :ok
```

Deletes a value from the store.

# `get`

```elixir
@spec get(domain(), term(), term()) :: value :: term()
```

Retrieves a value from the store. Returns `default` if not found.

# `increment`

```elixir
@spec increment(domain(), term(), integer()) :: integer()
```

Atomically increments or decrements a counter.

You must previously set an initial value.

# `put`

```elixir
@spec put(domain(), term(), term()) :: :ok
```

Sets a value in the store.

# `update`

```elixir
@spec update(domain(), term(), (domain() -&gt; term())) :: :ok
```

Updates a store key by applying a function to the current value. This operation is serialized.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
