utils

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 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)
	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
	OutputSbomFormat string

	// Validate (local) flags
	ForcedJsonSchemaFile    string
	Variant                 string
	ValidateProperties      bool
	CustomValidation        bool
	CustomValidationOptions CustomValidationFlags

	// Summary formats (i.e., only valid for summary)
	// NOTE: "query" and "list" (raw) commands always returns JSON by default
	OutputFormat string // e.g., TXT (default), CSV, markdown (normalized to lowercase)

	// 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
}

Jump to

Keyboard shortcuts

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