Documentation
¶
Index ¶
- type BufferedMessageReceiver
- func (b *BufferedMessageReceiver) Filter(filters *Filters, done <-chan struct{}) <-chan string
- func (b *BufferedMessageReceiver) HandleMessage(m *message.Message, rendered []byte, eventType string)
- func (b *BufferedMessageReceiver) IsEnabled() bool
- func (b *BufferedMessageReceiver) SetEnabled(e bool) bool
- func (b *BufferedMessageReceiver) Start()
- func (b *BufferedMessageReceiver) Stop()
- type Filters
- type Formatter
- type MessageReceiver
- type NoopMessageReceiver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedMessageReceiver ¶
type BufferedMessageReceiver struct {
// contains filtered or unexported fields
}
BufferedMessageReceiver handles in coming log messages and makes them available for diagnostics
func NewBufferedMessageReceiver ¶
func NewBufferedMessageReceiver(f Formatter, hostname hostnameinterface.Component) *BufferedMessageReceiver
NewBufferedMessageReceiver creates a new MessageReceiver. It takes an optional Formatter as a parameter, and defaults to using logFormatter if not supplied.
func (*BufferedMessageReceiver) Filter ¶
func (b *BufferedMessageReceiver) Filter(filters *Filters, done <-chan struct{}) <-chan string
Filter writes the buffered events from the input channel formatted as a string to the output channel
func (*BufferedMessageReceiver) HandleMessage ¶
func (b *BufferedMessageReceiver) HandleMessage(m *message.Message, rendered []byte, eventType string)
HandleMessage buffers a message for diagnostic processing
func (*BufferedMessageReceiver) IsEnabled ¶
func (b *BufferedMessageReceiver) IsEnabled() bool
IsEnabled returns the enabled state of the message receiver
func (*BufferedMessageReceiver) SetEnabled ¶
func (b *BufferedMessageReceiver) SetEnabled(e bool) bool
SetEnabled start collecting log messages for diagnostics. Returns true if state was successfully changed
func (*BufferedMessageReceiver) Start ¶
func (b *BufferedMessageReceiver) Start()
Start opens new input channel
func (*BufferedMessageReceiver) Stop ¶
func (b *BufferedMessageReceiver) Stop()
Stop closes the input channel
type Filters ¶
type Filters struct { Name string `json:"name"` Type string `json:"type"` Source string `json:"source"` Service string `json:"service"` }
Filters for processing log messages
type Formatter ¶
type Formatter interface { // Format transforms the supplied message.Message into a more user-friendly format, for diagnostic purposes. Format(*message.Message, string, []byte) string }
Formatter defines how a particular message.Message should be formatted
type MessageReceiver ¶
MessageReceiver interface to handle messages for diagnostics
type NoopMessageReceiver ¶
type NoopMessageReceiver struct{}
NoopMessageReceiver for cases where diagnosing messages is unsupported or not needed (tests)
func (*NoopMessageReceiver) HandleMessage ¶
func (n *NoopMessageReceiver) HandleMessage(_ *message.Message, _ []byte, _ string)
HandleMessage does nothing with the message