type Parser … type Message … func NewParser() (Parser, error) { … } type ReadSeekCloser … type parser … func getBootTime() (time.Time, error) { … } func (p *parser) SetLogger(log Logger) { … } func (p *parser) Close() error { … } func (p *parser) SeekEnd() error { … } // Parse will read from the provided reader and provide a channel of messages // parsed. // If the provided reader *is not* a proper Linux kmsg device, Parse might not // behave correctly since it relies on specific behavior of `/dev/kmsg` // // A goroutine is created to process the provided reader. The goroutine will // exit when the given reader is closed. // Closing the passed in reader will cause the goroutine to exit. func (p *parser) Parse() <-chan Message { … } func (p *parser) parseMessage(input string) (Message, error) { … }