logs

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionOnRunState

type ActionOnRunState func(state structs.RunState, stackID, runID string) error

type Explorer

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

Explorer allows you to explore run logs, either for a stack or a module.

It's a single use object, which should be thrown away after use.

func NewModuleExplorer added in v1.25.0

func NewModuleExplorer(moduleID, run string, opts ...Option) *Explorer

NewModuleExplorer creates a new Explorer for a run belonging to a module. By default the explorer always tails the logs.

func NewStackExplorer added in v1.25.0

func NewStackExplorer(stackID, run string, opts ...Option) *Explorer

NewStackExplorer creates a new Explorer for a run belonging to a stack. By default the explorer always tails the logs.

func (*Explorer) RunFilteredLogs

func (e *Explorer) RunFilteredLogs(ctx context.Context) (terminal *structs.RunStateTransition, err error)

RunFilteredLogs runs the explorer, printing filtered logs to stdout.

func (*Explorer) RunFilteredStates

func (e *Explorer) RunFilteredStates(ctx context.Context, sink chan<- string) (*structs.RunStateTransition, error)

RunFilteredStates runs the explorer, sending filtered logs to the given sink channel.

Usually you want to use RunFilteredLogs instead.

type Option

type Option func(*Explorer)

Option is a functional option for configuring an Explorer

func WithActionOnRunState

func WithActionOnRunState(acFn ActionOnRunState) Option

WithActionOnRunState sets an action to be executed on each run state

func WithTail

func WithTail(tail bool) Option

WithTail sets whether to tail the logs

func WithTargetPhase

func WithTargetPhase(phase *structs.RunState) Option

WithTargetPhase sets the target phase to filter logs

Jump to

Keyboard shortcuts

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