scanner

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthCheckEndpoint    = "/Health/Check"
	ScanKubernetesEndpoint = "/Scan/RunKubernetesManifest"

	// A valid result would come back as a '2'
	ValidScanResult = uint32(2)
)

Variables

This section is empty.

Functions

func DefaultHttpClient

func DefaultHttpClient() *http.Client

Types

type File

type File struct {
	Data []byte `json:"data,omitempty"`
}

type HealthCheckRequest

type HealthCheckRequest struct{}

type HealthCheckResponse

type HealthCheckResponse struct {
	Status string `json:"status,omitempty"`
	// returns rfc 3339 timestamp
	Time string `json:"time,omitempty"`
	// returns the major api version
	ApiVersion string `json:"apiVersion,omitempty"`
	// returns the git commit checksum
	Build string `json:"build,omitempty"`
}

type KubernetesManifestJob

type KubernetesManifestJob struct {
	Files  []*File           `json:"files,omitempty"`
	Labels map[string]string `json:"labels,omitempty"`
}

type ScanResult

type ScanResult struct {
	WorstScore *Score `json:"worstScore,omitempty"`
	Ok         bool   `json:"ok,omitempty"`
}

type Scanner

type Scanner struct {
	Endpoint string
	Token    string
	// contains filtered or unexported fields
}

func (*Scanner) HealthCheck

func (s *Scanner) HealthCheck(ctx context.Context, in *HealthCheckRequest) (*HealthCheckResponse, error)

func (*Scanner) RunKubernetesManifest

func (s *Scanner) RunKubernetesManifest(ctx context.Context, in *KubernetesManifestJob) (*ScanResult, error)

type Score

type Score struct {
	QrId            string `json:"qr_id,omitempty"`
	Type            uint32 `json:"type,omitempty"`
	Value           uint32 `json:"value,omitempty"`
	Weight          uint32 `json:"weight,omitempty"`
	ScoreCompletion uint32 `json:"score_completion,omitempty"`
	DataTotal       uint32 `json:"data_total,omitempty"`
	DataCompletion  uint32 `json:"data_completion,omitempty"`
	Message         string `json:"message,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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