model

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NotifFmtHTML indicates notification has HTML format.
	NotifFmtHTML = iota
	// NotifFmtText indicates notification has Text format.
	NotifFmtText

	// ScanType identifies the scan report type.
	ScanType = "scan"

	// LiveReportType identifies the live report type.
	LiveReportType = "livereport"

	// StatusGenerating indicates that report is being generated.
	StatusGenerating = "GENERATING"
	// StatusFinished indicates that report has been generated.
	StatusFinished = "FINISHED"
	// StatusFailed indicates that report generation failed.
	StatusFailed = "FAILED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseReport

type BaseReport struct {
	ID           string
	Files        []FileInfo
	Notification Notification
	DeliveredTo  []string
	Status       string
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

BaseReport represents the common fields for all types of reports.

type FileInfo

type FileInfo struct {
	FilePath   string
	DestBucket string
	DestPath   string
}

FileInfo contains report file and its upload destination.

type LiveReport

type LiveReport struct {
	BaseReport
	TeamID   string
	DateFrom string
	DateTo   string
}

LiveReport represents a report for vulcan team.

func (*LiveReport) GetCreatedAt

func (r *LiveReport) GetCreatedAt() time.Time

func (*LiveReport) GetDateFrom

func (r *LiveReport) GetDateFrom() string

func (*LiveReport) GetDateTo

func (r *LiveReport) GetDateTo() string

func (*LiveReport) GetDeliveredTo

func (r *LiveReport) GetDeliveredTo() []string

func (*LiveReport) GetFiles

func (r *LiveReport) GetFiles() []FileInfo

func (*LiveReport) GetID

func (r *LiveReport) GetID() string

func (*LiveReport) GetNotification

func (r *LiveReport) GetNotification() Notification

func (*LiveReport) GetStatus

func (r *LiveReport) GetStatus() string

func (*LiveReport) GetTeamID

func (r *LiveReport) GetTeamID() string

func (*LiveReport) GetUpdatedAt

func (r *LiveReport) GetUpdatedAt() time.Time

type NotifFmt

type NotifFmt uint8

NotifFmt represents the report notification format.

type Notification

type Notification struct {
	Subject string
	Body    string
	Fmt     NotifFmt
}

Notification represents a report notification.

type Report

type Report interface {
	GetID() string
	GetFiles() []FileInfo
	GetNotification() Notification
	GetDeliveredTo() []string
	GetStatus() string
	GetCreatedAt() time.Time
	GetUpdatedAt() time.Time
}

Report represents the interface which all report types must comply with.

type ReportType

type ReportType string

ReportType specifies a report type.

type ScanReport

type ScanReport struct {
	BaseReport
	ScanID         string
	ReportURL      string
	ReportJSONURL  string
	ProgramName    string
	Risk           int
	UpdateStatusAt time.Time
}

ScanReport represents a report for a vulcan scan.

func (*ScanReport) GetCreatedAt

func (r *ScanReport) GetCreatedAt() time.Time

func (*ScanReport) GetDeliveredTo

func (r *ScanReport) GetDeliveredTo() []string

func (*ScanReport) GetFiles

func (r *ScanReport) GetFiles() []FileInfo

func (*ScanReport) GetID

func (r *ScanReport) GetID() string

func (*ScanReport) GetNotification

func (r *ScanReport) GetNotification() Notification

func (*ScanReport) GetStatus

func (r *ScanReport) GetStatus() string

func (*ScanReport) GetUpdatedAt

func (r *ScanReport) GetUpdatedAt() time.Time

Jump to

Keyboard shortcuts

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