validate_yaml

package
v1.5.11 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_PASSED = "passed"
	STATUS_FAILED = "failed"
)

Variables

View Source
var YamlNotValidError = errors.New("")

Functions

func PrintValidationResults

func PrintValidationResults(printer IPrinter, invalidFiles []*pkgExtractor.InvalidFile, filesCount int)

func SendResults

func SendResults(localConfig ILocalConfig, client ICliClient, cliVersion string, isValid bool, invalidYamlFiles []*pkgExtractor.InvalidFile, filesPaths []string)

func SetSilentMode

func SetSilentMode(cmd *cobra.Command)

Types

type ICliClient

type ICliClient interface {
	SendValidateYamlResult(request *cliClient.ValidatedYamlResult)
}

type ILocalConfig

type ILocalConfig interface {
	GetLocalConfiguration() (*localConfig.LocalConfig, error)
}

type IPrinter

type IPrinter interface {
	GetFileNameText(title string) string
	GetYamlValidationErrorsText(validationErrors []error) string
	GetYamlValidationSummaryText(passedFiles int, allFiles int) string
	PrintMessage(messageText string, messageColor string)
}

type IReader

type IReader interface {
	FilterFiles(paths []string) ([]string, error)
}

type ValidateYamlCommandContext

type ValidateYamlCommandContext struct {
	Printer     IPrinter
	Reader      IReader
	Extractor   yamlValidator.IExtractor
	CliClient   ICliClient
	LocalConfig ILocalConfig
	CliVersion  string
}

Jump to

Keyboard shortcuts

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