diagnostic

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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() *BufferedMessageReceiver

NewBufferedMessageReceiver creates a new MessageReceiver

func (*BufferedMessageReceiver) HandleMessage

func (b *BufferedMessageReceiver) HandleMessage(m message.Message, redactedMsg []byte)

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) Next

func (b *BufferedMessageReceiver) Next(filters *Filters) (line string, ok bool)

Next pops the next buffered event off the input channel formatted as a string

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"`
}

Filters for processing log messages

type MessageReceiver

type MessageReceiver interface {
	HandleMessage(message.Message, []byte)
}

MessageReceiver interface to handle messages for diagnostics

type NoopMessageReceiver

type NoopMessageReceiver struct{}

NoopMessageReceiver for cases where diagnosing messages is unsupported or not needed (serverless, tests)

func (*NoopMessageReceiver) HandleMessage

func (n *NoopMessageReceiver) HandleMessage(m message.Message, redactedMsg []byte)

HandleMessage does nothing with the message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL