@@ -2,13 +2,13 @@ package syslog
22
33// Handler handles syslog messages
44type Handler interface {
5- // Handle should return Message (mayby modified) for future processing by
5+ // Handle should return Message (maybe modified) for future processing by
66 // other handlers or return nil. If Handle is called with nil message it
77 // should complete all remaining work and properly shutdown before return.
88 Handle (* Message ) * Message
99}
1010
11- // BaseHandler is desigend for simplify the creation of real handlers. It
11+ // BaseHandler is designed to simplify the creation of real handlers. It
1212// implements Handler interface using nonblocking queuing of messages and
1313// simple message filtering.
1414type BaseHandler struct {
@@ -18,7 +18,7 @@ type BaseHandler struct {
1818 ft bool
1919}
2020
21- // NewBaseHandler creates BaseHandler using specified filter. If filter is nil
21+ // NewBaseHandler creates BaseHandler using a specified filter. If filter is nil
2222// or if it returns true messages are passed to BaseHandler internal queue
2323// (of qlen length). If filter returns false or ft is true messages are returned
2424// to server for future processing by other handlers.
@@ -36,7 +36,7 @@ func NewBaseHandler(qlen int, filter func(*Message) bool, ft bool) *BaseHandler
3636// before return.
3737func (h * BaseHandler ) Handle (m * Message ) * Message {
3838 if m == nil {
39- close (h .queue ) // signal that ther is no more messages for processing
39+ close (h .queue ) // signal that there is no more messages for processing
4040 <- h .end // wait for handler shutdown
4141 return nil
4242 }
@@ -66,15 +66,15 @@ func (h *BaseHandler) Get() *Message {
6666 return nil
6767}
6868
69- // Queue returns BaseHandler internal queue as read-only channel. You can use
70- // it directly, especially if your handler need to select from multiple channels
69+ // Queue returns the BaseHandler internal queue as a read-only channel. You can use
70+ // it directly, especially if your handler needs to select from multiple channels
7171// or have to work without blocking. You need to check if this channel is closed by
7272// sender and properly shutdown in this case.
7373func (h * BaseHandler ) Queue () <- chan * Message {
7474 return h .queue
7575}
7676
77- // End signals the server that handler properly shutdown. You need to call End
77+ // End signals the server that the handler properly shutdown. You need to call End
7878// only if Get has returned nil before.
7979func (h * BaseHandler ) End () {
8080 close (h .end )
0 commit comments