reports

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetReport(ctx context.Context, scanID string) (*ScanReport, error)
	GetReportNotification(ctx context.Context, scanID string) (*Notification, error)
	SendReportNotification(ctx context.Context, scanID string, recipients []string) error
	GenerateReport(scanID, teamID, teamName, programName string, recipients []string, autoSend bool) error
	GenerateDigestReport(teamID, teamName, dateFrom, dateTo, liveReportURL string,
		recipients []string, severitiesStats map[string]int, autoSend bool) error
}

Client represents a client to interact with reports generator microservice.

func NewClient

func NewClient(cfg Config) (Client, error)

NewClient builds a new reports client.

type Config

type Config struct {
	SNSARN          string `mapstructure:"sns_arn"`
	SNSEndpoint     string `mapstructure:"sns_endpint"`
	APIBaseURL      string `mapstructure:"api_base_url"`
	InsecureTLS     bool   `mapstructure:"insecure_tls"`
	ScanRedirectURL string `mapstructure:"scan_redirect_url"`
	VulcanUIURL     string `mapstructure:"vulcanui_url"`
}

Config contains the configuration parameters for report related actions.

type Notification

type Notification struct {
	Subject string `json:"subject"`
	Body    string `json:"body"`
	Format  string `json:"format"`
}

Notification represents a report notification.

type ScanReport

type ScanReport struct {
	ID            string    `json:"id"`
	ReportURL     string    `json:"report_url"`
	ReportJSONURL string    `json:"report_json_url"`
	ScanID        string    `json:"scan_id"`
	ProgramName   string    `json:"program_name"`
	Status        string    `json:"status"`
	Risk          int       `json:"risk"`
	EmailSubject  string    `json:"email_subject"`
	EmailBody     string    `json:"email_body"`
	DeliveredTo   string    `json:"delivered_to"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

ScanReport represents a scan report data as returned by reports generator API.

Jump to

Keyboard shortcuts

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