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

config structure proposal #574

Closed
ewgRa opened this issue Aug 18, 2018 · 2 comments
Closed

config structure proposal #574

ewgRa opened this issue Aug 18, 2018 · 2 comments

Comments

@ewgRa
Copy link
Contributor

ewgRa commented Aug 18, 2018

For now example of config looks like that:

{
    "ifElseChain": {}
}

If there will be more generic checkers (like alternative call for example) it will not work, since I will want to use one checker several times with different parameters.

How about this structure?

{
  "version": 1,
  "checkers": {
    "ifElseChain": {
      "type": "ifElseChain"
    },
    "logpErrInsteadLogpWarn": {
      "type": "alternativeCall",
      "parameters": {
        "selector": "logp.Warn",
        "alternative": "logp.Err"
      }
    },
    "logFatalInsteadLogWarn": {
      "type": "alternativeCall",
      "parameters": {
        "selector": "log.Warn",
        "alternative": "log.Fatal"
      }
    }
  }
}
@ewgRa
Copy link
Contributor Author

ewgRa commented Aug 26, 2018

PR here #585

@quasilyte
Copy link
Member

We're using flags-only approach now, but checkers can have a param that is a filename that can be used to fetch any config during checker initialization.
For example, there is https://github.com/Quasilyte/go-police.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants