diagnostic

package
v0.85.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(f Formatter, hostname hostnameinterface.Component, config pkgconfigmodel.Reader) *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

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

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

Jump to

Keyboard shortcuts

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