plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package plugin collects the common code used by extractor and detector plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin interface {
	// A unique name used to identify this plugin.
	Name() string
	// Plugin version, should get bumped whenever major changes are made.
	Version() int
}

Plugin is the part of the plugin interface that's shared between extractors and detectors.

type ScanStatus

type ScanStatus struct {
	Status        ScanStatusEnum
	FailureReason string
}

ScanStatus is the status of a scan run. In case the scan fails, FailureReason contains details.

func (*ScanStatus) String

func (s *ScanStatus) String() string

String returns a string representation of the scan status.

type ScanStatusEnum

type ScanStatusEnum int

ScanStatusEnum is the enum for the scan status.

const (
	ScanStatusUnspecified ScanStatusEnum = iota
	ScanStatusSucceeded
	ScanStatusPartiallySucceeded
	ScanStatusFailed
)

ScanStatusEnum values.

type Status

type Status struct {
	Name    string
	Version int
	Status  *ScanStatus
}

Status contains the status and version of the inventory+vuln plugins that ran.

func StatusFromErr

func StatusFromErr(p Plugin, partial bool, err error) *Status

StatusFromErr returns a successful or failed plugin scan status for a given plugin based on an error.

Jump to

Keyboard shortcuts

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