logstream

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

logstream contains functionality for streaming logs for an entire application from Kubernetes. This functionality is based on github.com/stern/stern.

Package logstream is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct {
}

Impl is the implementation of logstream.Interface.

func (*Impl) Stream

func (i *Impl) Stream(ctx context.Context, options Options) error

Stream() configures and runs Stern, a library for streaming logs from Kubernetes pods, with custom filters and output formats based on the provided parameters. It returns an error if there is an issue configuring or running Stern.

type Interface

type Interface interface {
	// Stream opens a log stream and writes the application's log to the provided writer.
	// This function will block until the context is cancelled.
	Stream(ctx context.Context, options Options) error
}

Interface is the interface type for streaming application logs.

type MockInterface

type MockInterface struct {
	// contains filtered or unexported fields
}

MockInterface is a mock of Interface interface.

func NewMockInterface

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) Stream

func (m *MockInterface) Stream(arg0 context.Context, arg1 Options) error

Stream mocks base method.

type MockInterfaceMockRecorder

type MockInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) Stream

func (mr *MockInterfaceMockRecorder) Stream(arg0, arg1 interface{}) *gomock.Call

Stream indicates an expected call of Stream.

type Options

type Options struct {
	// ApplicationName is the name of the application.
	ApplicationName string

	// Namespace is the kubernetes namespace of the application.
	Namespace string

	// KubeContext is the name of the kubernetes context to use for connection.
	KubeContext string

	// Out is where output will be written.
	Out io.Writer
}

Options specifies the options for streaming application logs.

Jump to

Keyboard shortcuts

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