-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Refactor processors and readers #2088
Conversation
@urso We are currently using a mix of reader and processor. I see processor as a superset of reader, means I plan to rename all readers to processors and group them in one package. Any thoughts? |
+1 for consistent naming. At some point I intended to all 'LineReader's to be a processor. On the other, we already got processors (generic?) in libbeat. |
Alternatively we could rename everything to a reader? Looking at the readers / processors we have, reader would also be accurate I think. |
I think I'd prefer Reader here, to not get confused with libbeat processors. |
Agree. I will migrate everything to reader. How should be call the struct? |
7e4ab8f
to
ecc3726
Compare
|
||
// Encode reader produces lines by reading lines from an io.Reader | ||
// through a decoder converting the reader it's encoding to utf-8. | ||
type Encode struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm... I think we should name the Decode, Conver or Transform. This reader converts input encoding into utf8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Encode is still correct, but we could name it EncodeUTF8
to make it more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, rather use Encode or Encoding then EncodeUTF8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, we pass the codec, so it could be anything not only uft-8 if configured differently. In this case I would stick with reader.Encode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's still with it then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can still renamed it in combination with #2089 if something else becomes obvious.
* Rename all processors to readers * Rename line struct to Message * Remove "reader" from all structs inside reader package No logic changes are done in this change.
@urso requested changes pushed. |
LGTM. waiting for travis. |
I realized that when rebasing elastic#2091 on top of elastic#2088 a JSON test was lost. This resurrects it.
No logic changes are done in this change.