consumer

package
v0.86.0-sumo-1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Build(*zap.SugaredLogger, WriterOp) (Interface, error)
}

Builder builds a consumer

type CloseFunc

type CloseFunc func(ExecutionSummary)

CloseFunc

type DemoConsumer

type DemoConsumer struct {
	WriterOp
	Logger *zap.SugaredLogger
}

DemoConsumer stub consumer implementation. todo(ck) delete - this is a stub implementation for PoC purposes only.

func (*DemoConsumer) Consume

func (p *DemoConsumer) Consume(ctx context.Context, stdout, stderr io.Reader) CloseFunc

Consume reads stdout line by line and produces entries

type ExecutionSummary

type ExecutionSummary struct {
	Command     string
	ExitCode    int
	RunDuration time.Duration
}

ExecutionSummary describes a command execution

type Interface

type Interface interface {
	Consume(ctx context.Context, stdin, stderr io.Reader) CloseFunc
}

Interface consumes command output and emits telemetry data

type WriterOp

type WriterOp interface {
	NewEntry(value interface{}) (*entry.Entry, error)
	Write(ctx context.Context, e *entry.Entry)
}

WriterOp is the consumer's interface to the stanza pipeline

Jump to

Keyboard shortcuts

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