Giter Site home page Giter Site logo

emadalam / mahaul Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 2.0 425 KB

Supercharge your environment variables in Elixir. Parse and validate with compile time access guarantees, defaults, fallbacks and app pre-boot validations.

Home Page: https://hex.pm/packages/mahaul

License: MIT License

Elixir 98.93% Shell 1.07%
elixir elixir-library environment-variables

mahaul's People

Contributors

emadalam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

axelson zimt28

mahaul's Issues

[Feature Request]: Add base64 option

I'm currently dealing with a lot of base64 encrypted env variables, it would be helpful to have a base64: true option which decodes the value before parsing it.

Surprising behavior when passing an invalid type

Hi there! ๐Ÿ‘‹
First off, thanks for making this library! I'm excited to see an alternative approach to using environment variables in Elixir ๐ŸŽ‰

I didn't read the docs thoroughly the first time I started using this and I set up my env like so:

defmodule Dash.Env do
  use Mahaul,
    TRELLO_API_KEY: [type: :string],
    TRELLO_API_TOKEN: [type: :string],
    PIRATE_WEATHER_API_KEY: [type: :string]

This results in Dash.Env.validate() giving the following error even when those environment variables are set:

14:54:01.654 [warning] Elixir.Mahaul.Helpers: missing or invalid environment variables.
TRELLO_API_KEY
TRELLO_API_TOKEN
PIRATE_WEATHER_API_KEY

{:error, "TRELLO_API_KEY\nTRELLO_API_TOKEN\nPIRATE_WEATHER_API_KEY"}

After reading the docs I found that the correct type is :str, not :string, while I do have a slight preference for both of them working that's not my main point here. My main point is that I think that either at compile-time or runtime when calling Dash.Env.validate() I should get an error that the type was not recognized.

`default_test` option

Hi, cool library :)

It would be great to have a default_test option, similar to default_dev.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.