logstream

package
v0.0.0-...-6eb75e8 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (

	// ChaosDuck is the well known name for the chaosduck.
	ChaosDuck = "chaosduck"
	// QueueProxy is the well known name for the queueproxy.
	QueueProxy = "queueproxy"
)

Variables

This section is empty.

Functions

func WithLineFiltering

func WithLineFiltering(enabled bool) func(*logSource)

WithLineFiltering configures whether log lines will be filtered by the resource name.

func WithNamespaces

func WithNamespaces(namespaces ...string) func(*logSource)

WithNamespaces configures namespaces for log stream.

func WithPodPrefixes

func WithPodPrefixes(podPrefixes ...string) func(*logSource)

WithPodPrefixes specifies which Pods will be included in the log stream through the provided prefixes. If no prefixes are configured then logs from all Pods in the configured namespaces will be streamed.

Types

type Callback

type Callback func(string, ...interface{})

Callback is invoked after pod logs are transformed

type Canceler

type Canceler func()

Canceler is the type of a function returned when a logstream is started to be deferred so that the logstream can be stopped when the test is complete.

type Source

type Source interface {
	// Start a log stream for the given resource name and invoke
	// the callback with the processed log
	StartStream(name string, l Callback) (Canceler, error)
}

Source allows you to create streams for a given resource name

func FromNamespace

func FromNamespace(ctx context.Context, c kubernetes.Interface, namespace string, opts ...func(*logSource)) Source

func FromNamespaces

func FromNamespaces(ctx context.Context, c kubernetes.Interface, namespaces []string, opts ...func(*logSource)) Source

func New

func New(ctx context.Context, c kubernetes.Interface, opts ...func(*logSource)) Source

New creates a new log source. The source namespaces must be configured through log source options.

Jump to

Keyboard shortcuts

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