scan

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatPretty = "pretty"
	FormatJSON   = "json"
	FormatCSV    = "csv"
	FormatSARIF  = "sarif"
)

Variables

View Source
var (
	ErrMissingToken       = errors.New("missing token, please provide your GuardRails CLI token via -—token option or GUARDRAILS_CLI_TOKEN environment variable")
	ErrInvalidFormatParam = errors.New("failed to parse format value")
)
View Source
var (
	ErrFailedToSaveOutput = func(err error) error {
		return fmt.Errorf("Couldn't save output, %s", err.Error())
	}
)

Functions

This section is empty.

Types

type Args

type Args struct {
	Token  string
	Path   string
	Format string
	Output string
	Quiet  bool
}

Args provides arguments for scan command handler.

func (*Args) SetDefault

func (args *Args) SetDefault() error

SetDefault sets default value for some of args variables.

func (Args) Validate

func (args Args) Validate() error

type Handler

type Handler struct {
	Args         *Args
	Spinner      *spinner.Spinner
	Config       *config.Config
	OutputWriter *outputwriter.OutputWriter
	Repository   repository.Repository
	Archiver     archiver.Archiver
	GRClient     grclient.GuardRailsClient
}

Handler contains scan command dependencies.

func New

New instantiates new scan command handler.

func (*Handler) Execute

func (h *Handler) Execute(ctx context.Context) (constant.ExitCode, error)

Execute runs scan command.

func (*Handler) GetScanDataFormatter

func (h *Handler) GetScanDataFormatter(resp *guardrailsclient.GetScanDataResp) error

GetScanDataFormatter parses guardrailsclient.GetScanDataResp to chosen format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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