scanengine

package
v1.3.39 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScanEngineErrorKind = "Error calling scan engine"

	ErrProgramWithoutPolicyGroups = errors.New("Program has no policy groups")
	ErrNotFound                   = errors.New("Not found")
	ErrCreatingScan               = errors.New("Error creating scan")
	ErrGettingScan                = errors.New("Error getting scan")
	ErrGettingScans               = errors.New("Error getting scans")
	ErrAbortingScans              = errors.New("Error aborting scans")
	ErrUnprocessableEntity        = errors.New("UnprocessableEntity")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, httpClient *http.Client, config Config) *Client

NewClient returns a new scan engine client.

func (*Client) Abort

func (c *Client) Abort(scanID string) (*scanengine.GetScanResponse, error)

Abort send a signal to the scan engine to try to abort a scan.

func (*Client) Create

func (c *Client) Create(request scanengine.ScanRequest) (*scanengine.ScanResponse, error)

Create creates a scan in the scan engine.

func (*Client) CreateScanRequest

func (c *Client) CreateScanRequest(program api.Program, scheduledTime *time.Time, externalID, requestedBy, tag string) (scanengine.ScanRequest, error)

CreateScanRequest creates a scan by calling the scan engine using the information in the parameters.

func (*Client) Get

func (c *Client) Get(scanID string) (*scanengine.GetScanResponse, error)

func (*Client) GetScans

func (c *Client) GetScans(externalID string) (*scanengine.GetScansResponse, error)

GetScans returns all the scans belonging to a team.

type Config

type Config struct {
	Url string `mapstructure:"url"`
}

type GenericError

type GenericError struct {
	Code int
	Msg  string
}

func (GenericError) Error

func (g GenericError) Error() string

Jump to

Keyboard shortcuts

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