common

package
v0.0.0-...-911ba08 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerfileEcosystem = "dockerfile"
	FormatJSON          = "json"
	FormatSpdx          = "spdx"
	FormatCdx           = "cdx"
	DefaultFilename     = "results"
)

DockerfileEcosystem :

Variables

This section is empty.

Functions

func SaveFile

func SaveFile(filename string, data []byte)

func SearchFiles

func SearchFiles(repoDir, pattern string) []string

SearchFiles returns matched file patterns or nil if none found

func TrimQuoteMarks

func TrimQuoteMarks(value string) string

TrimQuoteMarks returns a string with its quotation marks removed

Types

type Artifact

type Artifact struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Version     string `json:"version,omitempty"`
	IsDirectory bool   `json:"isDirectory"`
	SHA256      string `json:"sha256,omitempty"`
}

Artifact presents a resource

type BuildStage

type BuildStage struct {
	StageID         string            `json:"stage_id"`
	Context         string            `json:"key"`
	DependsOn       string            `json:"parent_stage"`
	ScratchBuild    bool              `json:"is_scratch_build"`
	StartLineNo     int               `json:"start_line"`
	EndLineNo       int               `json:"end_line"`
	Image           Image             `json:"base_image"`
	Packages        []Package         `json:"os_packages"`
	AppPackages     []Package         `json:"app_packages"`
	PackageOverride []PackageOverride `json:"package_override"`
	DockerFileCmds  []*parser.Node    `json:"-"`
	AddOnInstalls   []InstallTrace    `json:"addon_installs"`
	EnvVariables    map[string]string `json:"env_variables,omitempty"`
	AddOnSpdxReport string            `json:"addon_spdx_report"`
}

BuildStage :

type CommandSet

type CommandSet struct {
	Commands map[int]string
}

CommandSet is a set of commands in their execution order

type DiscoverOpts

type DiscoverOpts struct {
	DockerfilePath string
	OutFilepath    string
	Format         string
	Image          string
	Namespace      string
	SaveTrace      bool
}

DiscoverOpts :

type Dockerfile

type Dockerfile struct {
	Filepath    string            `json:"filepath"`
	Filehash    string            `json:"filehash"`
	FileType    string            `json:"filetype"`
	BuildStages []BuildStage      `json:"build_stages"`
	BuildArgs   map[string]string `json:"build_args,omitempty"`
}

Dockerfile :

type Image

type Image struct {
	Name      string    `json:"name"`
	Tag       string    `json:"tag"`
	OSName    string    `json:"os_name"`
	OSVersion string    `json:"os_version"`
	SHA256    string    `json:"sha256"`
	Metadata  string    `json:"metadata"`
	Packages  []Package `json:"packages"`
	Scanned   bool      `json:"scanned"`
}

Image :

type InstallTrace

type InstallTrace struct {
	Origin     string        `json:"origin"`
	OriginHash string        `json:"originhash,omitempty"`
	Traces     map[int]Trace `json:"traces,omitempty"`
}

InstallTrace presents an add-on installation and its traces

type ManifestFile

type ManifestFile struct {
	CommitID  string    `json:"commitid"`
	GitURL    string    `json:"giturl"`
	GitBranch string    `json:"gitbranch"`
	Filepath  string    `json:"filepath"`
	Filehash  string    `json:"filehash"`
	FileType  string    `json:"filetype"`
	Packages  []Package `json:"packages"`
	Scanned   bool      `json:"scanned"`
}

ManifestFile :

type Package

type Package struct {
	Name         string   `json:"name"`
	Version      string   `json:"version"`
	Ecosystem    string   `json:"ecosystem"`
	Source       string   `json:"source,omitempty"`
	Key          string   `json:"key,omitempty"`
	Dependencies []string `json:"dependencies,omitempty"`
}

Package :

type PackageOverride

type PackageOverride struct {
	BasePackage     string `json:"base_package"`
	OverridePackage string `json:"override_package"`
}

PackageOverride :

type SpdxFile

type SpdxFile struct {
	FileName             string `json:"filename"`
	SPDXID               string `json:"spdxid"`
	FileChecksum         string `json:"fileCheckSum,omitempty"`
	FileDownloadLocation string `json:"fileDownloadLocation,omitempty"`
	LicenseConcluded     string `json:"licenseConcluded,omitempty"`
	LicenseInfoInFile    string `json:"licenseInfoInfile,omitempty"`
	FileCopyrightText    string `json:"fileCopyrightText,omitempty"`
	FileComment          string `json:"fileComment,omitempty"`
}

type SpdxRelationship

type SpdxRelationship string

type Trace

type Trace struct {
	Command     string `json:"command"`
	Source      string `json:"source,omitempty"`
	Destination string `json:"destination,omitempty"`
	Workdir     string `json:"workdir,omitempty"`
}

Trace : step trace of dockerfile add-on installations via RUN curl/wget/ or COPY/ADD

type VerifiedArtifact

type VerifiedArtifact struct {
	IsDownload       bool       `json:"isDownload"`
	DownloadLocation string     `json:"downloadLocation"`
	Comment          string     `json:"packageComment,omitempty"`
	Artifacts        []Artifact `json:"artifacts,omitempty"`
}

Jump to

Keyboard shortcuts

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