Skip to content
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

Improvements to visor.Config #339

Closed
evanlinjin opened this issue Apr 21, 2020 · 0 comments
Closed

Improvements to visor.Config #339

evanlinjin opened this issue Apr 21, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@evanlinjin
Copy link
Contributor

evanlinjin commented Apr 21, 2020

Feature description

Currently config generation is split across multiple areas (depending on the use case). Specifically in the following two files:

My proposal is this:

  • Have a single function within visor module defined as visor.DefaultConfig() *Config.
  • This can be directly as the definition for skywire-cli visor gen-config.
  • For missing fields when skywire-visor is run, we can do:
    conf := DefaultConfig()
    err := json.NewDecoder(file).Decode(conf)
    This way, we we set default values first, and user-set values will overwrite default values.

Further considerations:

  • Maybe set .DisallowUnknownFields() for json decoder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant