scans

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCheckNotFinished is returned by the client when a check of a scan does
	// not have report because is not FINISHED.
	ErrCheckNotFinished = errors.New("Check status is not FINISHED")
)

Functions

This section is empty.

Types

type CheckData

type CheckData struct {
	coreclient.Checkdata
	Report ReportData
}

CheckData contains the info regarding a check of a scan.

type CheckReportClient

type CheckReportClient interface {
	GetReport(url string) (*report.Report, error)
}

CheckReportClient defines the services needed by the concurrent client.

type Client

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

Client allows to get the reports of a scan concurrently.

func NewClient

func NewClient(coreClient *coreclient.Client, reportClient CheckReportClient, workers int) *Client

NewClient returns a new client scans client.

func (*Client) Data

func (c *Client) Data(ctx context.Context, ID string) (ScanData, error)

Data downloads all the reports of a given scan using, at most, the specified number of goroutines in the client.

type ErrorUnexpectedStatus

type ErrorUnexpectedStatus struct {
	Expected int
	Got      int
}

ErrorUnexpectedStatus is returned when one of calls made by the concurrent client to one endpoint of vulcan core returns an unexpected http status.

func (*ErrorUnexpectedStatus) Error

func (e *ErrorUnexpectedStatus) Error() string

type ReportData

type ReportData struct {
	Err error
	report.Report
}

ReportData contanis either the info regarding the report of a check or the error that the client got trying to dowload it.

type ScanData

type ScanData struct {
	CreationDate string
	ChecksData   map[string]CheckData
}

ScanData define the data of a scan retrieved by the scans client.

Jump to

Keyboard shortcuts

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