Graylog2 / go-gelf

GELF library for Go
http://godoc.org/github.com/Graylog2/go-gelf/gelf
MIT License
103 stars 64 forks source link

No exported method for creating TCPReaders #21

Closed zbuc closed 6 years ago

zbuc commented 6 years ago

There is a newTCPReader function, however it isn't exported. There doesn't seem to be an exported method of creating TCP-based reader applications that use this library.

https://github.com/Graylog2/go-gelf/blob/v2/gelf/tcpreader.go#L22

joschi commented 6 years ago

@zbuc TCPReader is just a helper class for the test cases of go-gelf and is not supposed to be exported.

https://github.com/Graylog2/go-gelf/blob/4143646226541087117ff2f83334ea48b3201841/gelf/tcpwriter_test.go#L22

zbuc commented 6 years ago

Is there any way of creating a TCP reader instead of UDP? The exported method in Reader.go is only a UDP reader. The readme file for the v2 branch says TCP is supported.

On Feb 28, 2018, at 2:59 AM, Jochen Schalanda notifications@github.com wrote:

@zbuc TCPReader is just a helper class for the test cases of go-gelf and is not supposed to be exported.

https://github.com/Graylog2/go-gelf/blob/4143646226541087117ff2f83334ea48b3201841/gelf/tcpwriter_test.go#L22

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

joschi commented 6 years ago

@zbuc go-gelf is a GELF client library and doesn't provide any GELF server parts.

zbuc commented 6 years ago

Oh. In V1 (and V2) some GELF server parts are exposed (and work fine), but only for UDP.

On Wed, Feb 28, 2018 at 10:13 AM, Jochen Schalanda <notifications@github.com

wrote:

@zbuc https://github.com/zbuc go-gelf is a GELF client library and doesn't provide any GELF server parts.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Graylog2/go-gelf/issues/21#issuecomment-369269294, or mute the thread https://github.com/notifications/unsubscribe-auth/AAiyuHhwmdoMuLEvbnfi5Xt8bKNREIJiks5tZWxdgaJpZM4SVpzV .

joschi commented 6 years ago

Maybe @mariussturm would like to add a comment here.

mariussturm commented 6 years ago

Like @joschi said, this is a pure client library. The reader parts you see are used exclusively for testing and should not be used in any application project.

zbuc commented 6 years ago

FWIW, this code: https://github.com/Graylog2/go-gelf/blob/v2/gelf/reader.go#L24 is publicly exported and works fine for UDP GELF servers from my testing.