Usher.Config (Usher v0.1.2)
View SourceConfiguration management for Usher.
Handles loading and validating configuration from the application environment.
Summary
Functions
Returns all Usher configuration as a keyword list.
Returns the configured default expiration duration.
Returns the configured Ecto repository.
Returns the configured table name for invitations.
Returns the configured token length.
Functions
Returns all Usher configuration as a keyword list.
Useful for debugging or displaying current configuration.
Examples
iex> Usher.Config.all()
[
repo: MyApp.Repo,
token_length: 16,
default_expires_in: {7, :day},
table_name: "usher_invitations"
]
Returns the configured default expiration duration.
Accepts a Duration.unit_pair()
, such as {30, :minute}
.
See the docs for Duration.
Defaults to 7 days if not configured.
Returns the configured Ecto repository.
This is required for Usher to function and must be set in your application config:
config :usher, repo: MyApp.Repo
Raises if not configured.
Returns the configured table name for invitations.
Defaults to "usher_invitations" if not configured.
Examples
# Default
iex> Usher.Config.table_name()
"usher_invitations"
# Configured
config :usher, table_name: "my_invitations"
iex> Usher.Config.table_name()
"my_invitations"
Returns the configured token length.
Defaults to 16 characters if not configured.