monitor

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInsufficientPermissions = errors.New("insufficient permissions")
)

Functions

func Compose

func Compose(
	cmd *command.StartMonitor,
	fanMon fanotify.Monitor,
	ptMon ptrace.Monitor,
	signalCh chan os.Signal,
	errorCh chan error,
) *monitor

func NonCriticalError

func NonCriticalError(err error) error

Types

type CompositeMonitor

type CompositeMonitor interface {
	// Start() is not reentrant!
	Start() error

	// Just a helper getter.
	StartCommand() *command.StartMonitor

	SignalTargetApp(s os.Signal)

	Cancel()

	// Done() is reentrant. Every invocation returns the same instance of the channel.
	Done() <-chan struct{}

	// Errors() method is a way to communicate non-fatal monitor's error
	// conditions back to the caller. The method is reentrant. Every invocation
	// returns the same instance of the channel. The error channel is never closed,
	// but ideally it should stop returning eny errors after the monitor is done
	// (the actual behavior might differ due to the subordinate monitors, especially
	// the one at pkg/monitors/ptrace).
	Errors() <-chan error

	// Helper method to read left-over non-critical error events after the monitor
	// is done.
	DrainErrors() []error

	Status() (*CompositeReport, error)
}

func NewCompositeMonitor

func NewCompositeMonitor(
	ctx context.Context,
	cmd *command.StartMonitor,
	workDir string,
	del mondel.Publisher,
	artifactsDir string,
	mountPoint string,
	origPaths map[string]struct{},
) (CompositeMonitor, error)

type CompositeReport

type CompositeReport struct {
	PeReport  *report.PeMonitorReport
	FanReport *report.FanMonitorReport
	PtReport  *report.PtMonitorReport
}

type NewCompositeMonitorFunc

type NewCompositeMonitorFunc func(
	ctx context.Context,
	cmd *command.StartMonitor,
	workDir string,
	del mondel.Publisher,
	artifactsDir string,
	mountPoint string,
	origPaths map[string]struct{},
) (CompositeMonitor, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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