utils

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAnyToAny

func ConvertAnyToAny(values ...interface{})

TODO: function NOT complete, only placeholder type switch

func ConvertMapToJson

func ConvertMapToJson(mapIn interface{}) (string, error)

NOTE: simple wrapper method on json package to standardize parms

func ConvertStructToMap

func ConvertStructToMap(structIn interface{}) (mapOut map[string]interface{}, err error)

func FindVerifyConfigFileAbsPath

func FindVerifyConfigFileAbsPath(logger *log.MiniLogger, filename string) (absFilename string, err error)

func IsValidJsonMap

func IsValidJsonMap(test string) bool

func IsValidJsonRaw

func IsValidJsonRaw(test []byte) bool

Types

type CommandFlags

type CommandFlags struct {
	// Not flags, but "main" package var copies
	Project    string
	Binary     string
	Version    string
	WorkingDir string
	ExecDir    string

	// Configurations
	ConfigSchemaFile           string
	ConfigCustomValidationFile string
	ConfigLicensePolicyFile    string

	// persistent flags (common to all commands)
	PersistentFlags PersistentCommandFlags

	// Diff flags
	DiffFlags DiffCommandFlags

	// License flags
	LicenseFlags LicenseCommandFlags

	// Vulnerability flags
	VulnerabilityFlags VulnerabilityCommandFlags

	// Validate (local) flags
	ValidateFlags           ValidateCommandFlags
	CustomValidationOptions CustomValidationFlags

	// Log indent
	LogOutputIndentCallstack bool
}
var GlobalFlags CommandFlags

Globals

func (*CommandFlags) String

func (flags *CommandFlags) String() string

format and output the MyFlags struct as a string using Go's Stringer interface

type CustomValidationFlags

type CustomValidationFlags struct {
	Composition bool
	License     bool
	Properties  bool
}

type DiffCommandFlags added in v0.12.0

type DiffCommandFlags struct {
	Colorize    bool
	RevisedFile string
}

type LicenseCommandFlags added in v0.10.0

type LicenseCommandFlags struct {
	Summary      bool
	ListLineWrap bool
}

type PersistentCommandFlags added in v0.12.0

type PersistentCommandFlags struct {
	Quiet        bool // suppresses all non-essential (informational) output from a command. Overrides any other log-level commands.
	Trace        bool // trace logging
	Debug        bool // debug logging
	InputFile    string
	OutputFile   string // TODO: TODO: Note: not used by `validate` command, which emits a warning if supplied
	OutputFormat string // e.g., "txt", "csv"", "md" (markdown) (normalized to lowercase)
}

NOTE: These flags are shared by both the list and policy subcommands

type ValidateCommandFlags added in v0.11.0

type ValidateCommandFlags struct {
	SchemaVariant        string
	ForcedJsonSchemaFile string
	// Uses custom validation flags if "true"; defaults to config. "custom.json"
	CustomValidation bool
	// error result processing
	MaxNumErrors              int
	MaxErrorDescriptionLength int
	ColorizeErrorOutput       bool
	ShowErrorValue            bool
}

type VulnerabilityCommandFlags added in v0.11.0

type VulnerabilityCommandFlags struct {
	Summary bool
}

Jump to

Keyboard shortcuts

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