client

package
v0.0.0-...-d251121 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrivyClient

type TrivyClient struct{}

TrivyClient struct

func (*TrivyClient) ClearCache

func (c *TrivyClient) ClearCache(ctx context.Context) ([]byte, error)

ClearCache clears local trivy image cache

func (*TrivyClient) Do

func (c *TrivyClient) Do(ctx context.Context, image string) ([]byte, error)

Do implements the core functionality of the client

func (*TrivyClient) UpdateDatabase

func (c *TrivyClient) UpdateDatabase(ctx context.Context) ([]byte, error)

UpdateDatabase fetches the trivy vulnerability database

type TrivyResponse

type TrivyResponse struct {
	ArtifactName string `json:"ArtifactName"`
	ArtifactType string `json:"ArtifactType"`
	Results      []struct {
		Target          string               `json:"Target"`
		Vulnerabilities []TrivyVulnerability `json:"Vulnerabilities"`
	} `json:"Results"`
}

TrivyResponse top level struct to unmarshal the required fields from the json output file

type TrivyVulnerability

type TrivyVulnerability struct {
	VulnerabilityID  string   `json:"VulnerabilityID"`
	PkgName          string   `json:"PkgName"`
	InstalledVersion string   `json:"InstalledVersion"`
	FixedVersion     string   `json:"FixedVersion"`
	Title            string   `json:"Title"`
	Description      string   `json:"Description"`
	Severity         string   `json:"Severity"`
	References       []string `json:"References"`
}

TrivyVulnerability sub struct to unmarshal the required fields from the json output file

Jump to

Keyboard shortcuts

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