tractusx

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliErrOutputFormat = iota
	WebErrOutputFormat
)
View Source
const MetadataFilename = ".tractusx"

Variables

View Source
var ErrorOutputFormat = CliErrOutputFormat

ErrorOutputFormat is used to control the output format of error message. Before running QualityGuideline.Test(), set the value to your preferred output format

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	ProductName       string       `yaml:"product"`
	LeadingRepository string       `yaml:"leadingRepository"`
	RepoCategory      string       `yaml:"repoCategory"`
	Repositories      []Repository `yaml:"repositories"`
	SkipReleaseChecks `yaml:"skipReleaseChecks"`
}

func MetadataFromFile

func MetadataFromFile(fileContent []byte) (*Metadata, error)

MetadataFromFile does take fileContent as byte slice and tries to deserialize it into Metadata. If the contents cannot be parsed into Metadata, an error is returned and Metadata will be nil

func MetadataFromLocalFile

func MetadataFromLocalFile(dir string) (*Metadata, error)

MetadataFromLocalFile will read a local file '.tractusx in the specified dir', that is supposed to contain information about a product. If the file exists, MetadataFromLocalFile will return the information as an instance of Metadata. If the file cannot be parsed or does not exist, an error is returned and Metadata will be nil

type Printer

type Printer interface {
	Print(message string)
	LogWarning(warning string)
	LogError(err string)
}

type QualityGuideline

type QualityGuideline interface {
	// Name returns the Name to the QualityGuideline to test.
	Name() string
	// Description returns a brief description of the tested QualityGuideline.
	Description() string
	// ExternalDescription returns a URL to more information about the QualityGuideline.
	ExternalDescription() string
	// Test executes the test and returns QualityResult. If any error occurs it
	// returns QualityResult.Passed false.
	Test() *QualityResult
	// IsOptional returns a bool it the test or QualityGuideline is optional or not.
	IsOptional() bool
}

QualityGuideline represents the QualityGuideline to check as an interface.

The interface provide information about Name, Description, ExternalDescription, the Test and the IsOptional bool.

type QualityResult

type QualityResult struct {
	Passed           bool
	ErrorDescription string
}

QualityResult implements test result via Passed bool and in case of error a ErrorDescription.

type Repository

type Repository struct {
	Name             string `yaml:"name"`
	UsageDescription string `yaml:"usage"`
	Url              string `yaml:"url"`
}

type SkipReleaseChecks added in v0.9.0

type SkipReleaseChecks struct {
	AlignedBaseImages []string `yaml:"alignedBaseImage"`
}

Jump to

Keyboard shortcuts

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