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

nsqd: config file support #279

Merged
merged 5 commits into from
Jan 23, 2014
Merged

nsqd: config file support #279

merged 5 commits into from
Jan 23, 2014

Conversation

mreiferson
Copy link
Member

consider first-class support for providing flags and options via config files.

I favor the format & behavior used by git, which allows for subsections dedicated to different components (and referencing those via dot notation.)

e.g.:

[core]
    whitespace = blank-at-eol,trailing-space,space-before-tab,blank-at-eof,tabwidth=4
    tabwidth = 4
core.whitespace=blank-at-eol,trailing-space,space-before-tab,blank-at-eof,tabwidth=4
core.tabwidth=4

@mreiferson
Copy link
Member

dare I say https://github.com/mojombo/toml?

@mreiferson
Copy link
Member

https://github.com/BurntSushi/toml seems to be the cleanest and most robust Go implementation

@mreiferson
Copy link
Member

RFR @jehiah

@mreiferson
Copy link
Member

according to travis it looks like https://github.com/BurntSushi/toml only supports go1.2 so I'll have to find a more fully compatible package...

@mreiferson
Copy link
Member

never mind, got it all working on all versions of Go... had to make some changes to how we handle travis + test.sh (see last commit)

cc @jehiah

@jehiah
Copy link
Member

jehiah commented Jan 5, 2014

looks good overall.. some questions/thoughts

  • should the nsqd.cfg end up in the distribution (and contrib/nsq.spec) as nsqd.cfg or nsqd.cfg.example ?
  • what are the future steps to adding config file support for nsqlookupd/nsqadmin? Did we want to do that here as well? (that's needed to make it easy to run those under docker too right?)
  • should we leave all options in the nsqd.cfg commented out so that as defaults evolve in the future the binary defaults are used, not defaults from an outdated config file. (thinking aloud)

@mreiferson
Copy link
Member

  1. yes, it should and it should probably be located and named contrib/nsqd.cfg.example
  2. I can do that here, I guess 😁
  3. hmmm, I don't think so because you would need to explicitly enable use of a config file via --config. Also, as implemented, command line flags supersede config file options.

@mreiferson
Copy link
Member

assuming travis is happy this is RFR @jehiah

@jehiah
Copy link
Member

jehiah commented Jan 23, 2014

💯 this is some of the worlds cleanest config handling.

jehiah added a commit that referenced this pull request Jan 23, 2014
@jehiah jehiah merged commit ca2f860 into nsqio:master Jan 23, 2014
@mreiferson
Copy link
Member

yea, I think one day I'll pull the guts (the option resolution) out into a separate package... I think it's generally useful

@mreiferson mreiferson deleted the config_file_279 branch January 23, 2014 04:59
windzhu0514 pushed a commit to windzhu0514/nsq that referenced this pull request May 15, 2020
Prep 1.0.8 release; drop dep support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants