Giter Site home page Giter Site logo

Comments (16)

stephenwithav avatar stephenwithav commented on May 29, 2024

Which configuration directives should be moved to yaml? The command line switches?

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git I'd like to work on this tomorrow. go-yaml is my go to.

from beanstalkg.

vimukthi-git avatar vimukthi-git commented on May 29, 2024

@stephenwithav there is not much to move right now, they are basically the parameters taken as command line arguments in main. You can ignore proxy_mode since I want to remove it.
One of the things I care about is to have the parameters defined in yaml to be read from the environment for example the port. this is useful for container environments.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git understood. I'll find a yaml package that allows environment variables to override.

Or I'll just overwrite anything that's also specified in the environment.

from beanstalkg.

vimukthi-git avatar vimukthi-git commented on May 29, 2024

@stephenwithav great let me know when you have found a good one.

You can take your time with this as its prioritised for v0.8.0 in our roadmap.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

https://github.com/spf13/viper

@vimukthi-git this library will work well.

from beanstalkg.

vimukthi-git avatar vimukthi-git commented on May 29, 2024

looks good, I have seen this lib before. We can go with it no problem.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git I'm about to push. The compiler complained when I removed proxy_mode from the config (variable defined and not used), so I went ahead and removed proxy support altogether since you wanted it gone.

Removing proxy support removed the call to getConfig, which led to the not used error for env, so I removed it, too.

from beanstalkg.

vimukthi-git avatar vimukthi-git commented on May 29, 2024

@stephenwithav can we try https://github.com/jinzhu/configor ? seems more simple and matching to our requirement.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git we certainly can try. The update will be pushed tomorrow.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git given flags, environment, and YAML, which is the highest priority?

I'm assuming command-line flags override environment variables, which override the YAML configuration.

Do you agree?

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git configor works, but doesn't follow the 12 Factor guidelines. Environment variables override command-line flags, when it should be the opposite.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

See here for the test: https://github.com/stephenwithav/configor-test

from beanstalkg.

vimukthi-git avatar vimukthi-git commented on May 29, 2024

@stephenwithav thanks for the update. Can we use it for now and may be fork and change it later to make it follow the correct override order?

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

@vimukthi-git yes we can. And I can mimic the 12 Factor behavior with configor, if needed.

from beanstalkg.

stephenwithav avatar stephenwithav commented on May 29, 2024

The example repo is now corrected to ensure that command-line flags override environment variables. I'll integrate it shortly.

from beanstalkg.

Related Issues (20)

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.