types

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	WaitReadyTimeout    = 1 * time.Minute
	GracefulStopTimeout = 10 * time.Second
	ScanTimeout         = 15 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginConfig

type PluginConfig struct {
	// Name is the name of the plugin scanner. This should be unique as only one PluginRunner with the same Name can exist.
	Name string `yaml:"name" mapstructure:"name"`
	// ImageName is the name of the docker image that will be used to run the plugin scanner
	ImageName string `yaml:"image_name" mapstructure:"image_name"`
	// InputDir is a directory where the plugin scanner will read the asset filesystem
	InputDir string `yaml:"input_dir" mapstructure:"input_dir"`
	// ScannerConfig is a json string that will be passed to the scanner in the plugin
	ScannerConfig string `yaml:"scanner_config" mapstructure:"scanner_config"`
	// TimeoutSeconds defines the number of seconds before the scan is marked failed due to timeout
	TimeoutSeconds int `yaml:"timeout_seconds" mapstructure:"timeout_seconds"`
	// BinaryMode is a flag to indicate that the plugin should be run as a binary
	BinaryMode bool `yaml:"binary_mode" mapstructure:"binary_mode"`
}

type PluginRunner

type PluginRunner interface {
	Start(ctx context.Context) error
	WaitReady(ctx context.Context) error
	Metadata(ctx context.Context) (*plugintypes.Metadata, error)
	Run(ctx context.Context) error
	WaitDone(ctx context.Context) error
	Stop(ctx context.Context) error
	Logs(ctx context.Context) (io.ReadCloser, error)
	Result(ctx context.Context) (io.ReadCloser, error)
	Remove(ctx context.Context) error
}

Jump to

Keyboard shortcuts

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