Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbernardo95/config_getters
Simple config value getter generator for Elixir applications
https://github.com/jbernardo95/config_getters
Last synced: 22 days ago
JSON representation
Simple config value getter generator for Elixir applications
- Host: GitHub
- URL: https://github.com/jbernardo95/config_getters
- Owner: jbernardo95
- License: mit
- Created: 2017-11-04T00:39:24.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-04T01:22:34.000Z (about 7 years ago)
- Last Synced: 2024-03-14T22:14:29.701Z (8 months ago)
- Language: Elixir
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# config_getters
[![Travis Build](https://api.travis-ci.org/jbernardo95/config_getters.svg?branch=master)](https://travis-ci.org/jbernardo95/config_getters/)
Simple config value getter generator for Elixir applications.
```elixir
# config/config.exs
use Mix.Configconfig :my_app, key1: value1
config :my_app, key2: value2
config :my_app, key3: value3# Without config_getters
def ApplcationModule do
# ...defp key1, do: Application.get_env(:my_app, :key1)
defp key2, do: Application.get_env(:my_app, :key2)
defp key3, do: Application.get_env(:my_app, :key3)# ...
end# With config_getters
def ApplicationModule do
use ConfigGettersconfig_getters :my_app, [:key1, :key2, :key3]
end
```## Installation
Add `config_getters` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:config_getters, "~> 0.1.0"}]
end
```Then run `mix deps.get` to get the package.
## Documentation
The project documentation can be found [here](https://hexdocs.pm/config_getters/).
## License
config_getters source code is licensed under the [MIT License](LICENSE).