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

reader: add Configure() #14

Merged
merged 1 commit into from
Nov 11, 2013
Merged

reader: add Configure() #14

merged 1 commit into from
Nov 11, 2013

Conversation

mreiferson
Copy link
Member

this makes it easy to use a JSON object to configure all options of the reader

@mreiferson
Copy link
Member Author

I refactored this to take a string "key" and an interface{} as the value... it makes a best effort attempt to coerce the value into whatever is appropriate for the specified key.

I think this approach is more generally useful than taking a simplejson object regardless of what happens in nsqio/nsq#267. It can be easily wrapped by something that walks a JSON tree and sets individual keys. It also adds per-key error handling.

takes a key as string and value as interface and attempts
to coerce the value into the appropriate format/type
based on the specified key.
@mreiferson
Copy link
Member Author

merge me @jphines, @jehiah, etc.

jehiah added a commit that referenced this pull request Nov 11, 2013
@jehiah jehiah merged commit d66d562 into nsqio:master Nov 11, 2013
@mreiferson mreiferson deleted the config_14 branch November 11, 2013 19:44
sthulb pushed a commit to HailoOSS/go-nsq that referenced this pull request Sep 14, 2016
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.

None yet

2 participants