-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Configuration file. #69
Comments
I would say it should follow (more or less) the layout of the config structure: Lines 26 to 33 in 4ad9ad1
It should have at least port and domain . URLPattern can be deduced from the domain .It could be a json or a yaml perhaps. In this respect, we should think about putting the services in the same file. This way we will have just one file, not two (config and services). I'm not sure if this the best ideea, but we already have them together in the config mentioned earlier. Using an established notation (like json or yaml) would only make the things easier. For example an error when adding a service through ergo command line is much more less likely. Also there are tested and tried tools for working with them. |
isn 't there already the option to include a config file during the run option? I'd like to try solving this by using the https://gopkg.in/yaml.v2 and a yaml file that can be called via a command line option hook |
TOML is pretty common for unix-based OS's... and it has pretty good support in Go. Thoughts? |
My biggest problem with using something like YAML (don't get me wrong.. it can be really cool), is that it can be pretty hard to create simple/trouble-free mappings for very simple configs. JSON is pretty verbose but is well known/easy to write, TOML is pretty simple but not very well known, HCL is super nice but also not very well known... don't get me started on code (Turing complete) based options (as cool as that could be). |
from what I understand we are just looking for 5 simple key value pairs which is really easy to write in both yaml and toml |
If you include the services, then you can have an arbitrary number of values. |
I think it is smarter to stick to one and mention it in the readme. |
Ok. Let's vote. |
something like this?
|
I like the look of the TOML 😋
…-sent from my OnePlus X
On Oct 25, 2017 3:39 PM, "Christian" ***@***.***> wrote:
something like this?
Port = 8080
Domain = .dev
URLPattern =
Verbose = false
[services]
foo = http://localhost:3000
bla = http://localhost:5000
withspaces = http://localhost:8080
one.domain = http://localhost:8081
two.domain = http://localhost:8082
redis://redislocal = redis://localhost:6543
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#69 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIIciL2cV7BkH56KAqnovA8sA8cIVfknks5sv454gaJpZM4QEZmv>
.
|
I had to make the toml look a bit different, but this is a first wip commit |
My only concern about having the services inside the configuration files is that it becomes being a little bureaucratic to manage. :/ Today for adding a new service you can use a simple
and is pretty much it for adding a new service. The idea is to have the same flexibility of I was thinking in this file more like something apart from the common flow. If you don't want to have custom configurations for ergo you don't need to be aware of its syntax or even its existence. Just use plain old "hosts" like syntax. I am familiar with TOML syntax I know it from Rust's cargo config file. I think it is pretty simple, my vote would be for it also. :) |
That would make the implementation a lot easier. |
I do agree that having services inside the config would make it a bit more difficult to manage.
That being said, I will bow to the power of the crowd 😃 And, of course, to the power of the project owner. |
the Unfortunatelly I do not have so much time on my hands to do this right now. I will add a Pull Request with the work I have done so far (watch the first commit) |
I was thinking to use ENV variables to solve those configs. What do you think about it? Something like:
Pros:
Cons:
|
That is a good ideea, but I also think we should consider two configuration options. |
No worries, let decide it first |
PR related #95 |
This issue is needed in order to enable run
ergo
using a custom TDL like.test
or any other the user would like to use.We need to decide the name of this file and its format.
The text was updated successfully, but these errors were encountered: