results

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxEntitySize defines the maximum number of bytes of the payloads the Results client
	// can send to the Results service.
	MaxEntitySize = 1024 * 1024 * 7 // 7 MB's
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RawData

type RawData struct {
	Raw           []byte    `json:"raw"`
	CheckID       string    `json:"check_id"`
	ScanID        string    `json:"scan_id"`
	ScanStartTime time.Time `json:"scan_start_time"`
}

RawData represents the payload for raw upload requests.

type ReportData

type ReportData struct {
	Report        string    `json:"report"`
	CheckID       string    `json:"check_id"`
	ScanID        string    `json:"scan_id"`
	ScanStartTime time.Time `json:"scan_start_time"`
}

ReportData represents the payload for report upload requests.

type Retryer

type Retryer interface {
	WithRetries(op string, exec func() error) error
}

Retryer represents the functions used by the Uploader for retrying http requests.

type Uploader

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

Uploader is responsible for uploading reports and logs to vulcan-results.

func New

func New(endpoint string, retryer Retryer, timeout time.Duration) *Uploader

New returns a new Uploader object pointing to the given endpoint.

func (*Uploader) UpdateCheckRaw

func (u *Uploader) UpdateCheckRaw(checkID string, scanStartTime time.Time, raw []byte) (string, error)

UpdateCheckRaw stores the log of the execution of a check in results service an returns a link that can be used to retrieve the logs.

func (*Uploader) UpdateCheckReport

func (u *Uploader) UpdateCheckReport(checkID string, scanStartTime time.Time, report report.Report) (string, error)

UpdateCheckReport stores the report of a check in the results service and returns the link that can be used to retrieve that report.

Jump to

Keyboard shortcuts

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