tools

package
v0.4.36 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommand added in v0.4.28

func CreateCommand(tool Interface) *cobra.Command

func TempFile added in v0.4.35

func TempFile(pattern string) (name string, err error)

Types

type DirectoryBasedToolOpts added in v0.4.28

type DirectoryBasedToolOpts struct {
	ToolOpts
	Directory         string
	Exclude           []string
	PrintFingerprints bool
	// contains filtered or unexported fields
}

func (*DirectoryBasedToolOpts) GetDirectory added in v0.4.28

func (o *DirectoryBasedToolOpts) GetDirectory() string

func (*DirectoryBasedToolOpts) GetDirectoryBasedToolOptions added in v0.4.34

func (o *DirectoryBasedToolOpts) GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts

func (*DirectoryBasedToolOpts) GetFilesInDirectory added in v0.4.34

func (o *DirectoryBasedToolOpts) GetFilesInDirectory(files []string) ([]string, error)

func (*DirectoryBasedToolOpts) GetInventory added in v0.4.34

func (o *DirectoryBasedToolOpts) GetInventory() *inventory.Manifest

func (*DirectoryBasedToolOpts) IsExcluded added in v0.4.34

func (o *DirectoryBasedToolOpts) IsExcluded(file string) bool

func (*DirectoryBasedToolOpts) Register added in v0.4.28

func (o *DirectoryBasedToolOpts) Register(cmd *cobra.Command)

func (*DirectoryBasedToolOpts) RemoveExcluded added in v0.4.34

func (o *DirectoryBasedToolOpts) RemoveExcluded(files []string) []string

func (*DirectoryBasedToolOpts) Validate added in v0.4.34

func (o *DirectoryBasedToolOpts) Validate() error

type DockerTool added in v0.4.29

type DockerTool struct {
	Name       string
	Image      string
	Directory  string
	DockerArgs []string
	Args       []string
}

type HasCommandTemplate added in v0.4.31

type HasCommandTemplate interface {
	CommandTemplate() *cobra.Command
}

type Interface

type Interface interface {
	options.Interface
	GetToolOptions() *ToolOpts
	GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts
	Validate() error
	Run() (*Result, error)
	Name() string
}

type Result

type Result struct {
	Data         *jnode.Node
	Findings     assessments.Findings
	Values       map[string]string
	Directory    string
	Files        *util.StringSet
	PrintPath    []string
	PrintColumns []string

	Assessment *assessments.Assessment
}

func (*Result) AddFile added in v0.4.21

func (r *Result) AddFile(path string) *Result

func (*Result) AddValue added in v0.4.21

func (r *Result) AddValue(name, value string) *Result

func (*Result) Report added in v0.4.30

func (r *Result) Report(tool Interface) error

type ToolOpts

type ToolOpts struct {
	options.PrintClientOpts
	UploadEnabled  bool
	UpdatePR       bool
	ToolVersion    string
	ToolPath       string
	FailThresholds map[string]string
	PrintAsessment bool
	Internal       bool
	SkipDockerPull bool

	ParsedFailThresholds map[string]int
}

func (*ToolOpts) GetDirectoryBasedToolOptions added in v0.4.34

func (o *ToolOpts) GetDirectoryBasedToolOptions() *DirectoryBasedToolOpts

func (*ToolOpts) GetToolOptions added in v0.4.28

func (o *ToolOpts) GetToolOptions() *ToolOpts

func (*ToolOpts) InstallAPIServerArtifact added in v0.4.28

func (o *ToolOpts) InstallAPIServerArtifact(name, urlPath string) (*download.Download, error)

func (*ToolOpts) InstallTool added in v0.4.29

func (o *ToolOpts) InstallTool(spec *download.Spec) (*download.Download, error)

func (*ToolOpts) PrintToolResult added in v0.4.36

func (o *ToolOpts) PrintToolResult(result *Result)

func (*ToolOpts) Register

func (o *ToolOpts) Register(c *cobra.Command)

func (*ToolOpts) RunDocker added in v0.4.29

func (o *ToolOpts) RunDocker(d *DockerTool) ([]byte, error)

func (*ToolOpts) RunTool

func (o *ToolOpts) RunTool(tool Interface, printResult bool) (*Result, error)

func (*ToolOpts) SetContextValues

func (o *ToolOpts) SetContextValues(m map[string]string)

func (*ToolOpts) Validate added in v0.4.32

func (o *ToolOpts) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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