cli

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GroupOutput []string
	Quiet       bool
)

GroupOutput is a global variable that is used to store the group by options that the user specifies

Functions

func GroupByDirectory added in v1.6.0

func GroupByDirectory(reports []reporter.Report) map[string][]reporter.Report

Group Reports by Directory

func GroupByDouble added in v1.6.0

func GroupByDouble(reports []reporter.Report, groupBy []string) (map[string]map[string][]reporter.Report, error)

Group Reports for two groupings

func GroupByFileType added in v1.6.0

func GroupByFileType(reports []reporter.Report) map[string][]reporter.Report

Group Reports by File Type

func GroupByPassFail added in v1.6.0

func GroupByPassFail(reports []reporter.Report) map[string][]reporter.Report

Group Reports by Pass-Fail

func GroupBySingle added in v1.6.0

func GroupBySingle(reports []reporter.Report, groupBy string) (map[string][]reporter.Report, error)

Group Reports by single grouping

func GroupByTriple added in v1.6.0

func GroupByTriple(reports []reporter.Report, groupBy []string) (map[string]map[string]map[string][]reporter.Report, error)

Group Reports for three groupings

Types

type CLI

type CLI struct {
	// FileFinder interface to search for the files
	// in the SearchPath
	Finder finder.FileFinder
	// Reporter interface for outputting the results of
	// the CLI run
	Reporters []reporter.Reporter
}

func Init

func Init(opts ...Option) *CLI

Initialize the CLI object

func (CLI) Run

func (c CLI) Run() (int, error)

The Run method performs the following actions: - Finds the calls the Find method from the Finder interface to return a list of files - Reads each file that was found - Calls the Validate method from the Validator interface to validate the file - Outputs the results using the Reporters

type Option added in v1.7.0

type Option func(*CLI)

Implement the go options pattern to be able to set options to the CLI struct using functional programming

func WithFinder added in v1.4.0

func WithFinder(f finder.FileFinder) Option

Set the CLI Finder

func WithGroupOutput added in v1.6.0

func WithGroupOutput(groupOutput []string) Option

func WithQuiet added in v1.6.0

func WithQuiet(quiet bool) Option

func WithReporters added in v1.8.0

func WithReporters(r ...reporter.Reporter) Option

Set the reporter types

Jump to

Keyboard shortcuts

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