Vapor v0.3.0 Vapor behaviour View Source

Vapor provides mechanisms for handling runtime configuration in your system.

Link to this section Summary

Functions

Starts a configuration store and any watches

Stops the configuration store and any watches

Callbacks

Fetches a value from the config under the key provided

Optional callback. Called when the configuration server starts. Passes the map of the reified values

Set the value under the key in the store

Link to this section Types

Link to this type

type() View Source
type() :: :string | :int | :float | :bool

Link to this section Functions

Link to this function

start_link(module, config, opts) View Source

Starts a configuration store and any watches.

Stops the configuration store and any watches.

Link to this section Callbacks

Link to this callback

get(key) View Source
get(key :: key()) :: term() | nil

Fetches a value from the config under the key provided.

Example

VaporExample.Config.get(:key)
Link to this callback

init(list) View Source
init([{key(), value()}]) :: :ok

Optional callback. Called when the configuration server starts. Passes the map of the reified values.

Link to this callback

set(key, value) View Source
set(key :: key(), value :: value()) :: {:ok, value()}

Set the value under the key in the store.

Example

VaporExample.Config.set(:key, "value")