reporting

package
v0.0.0-...-04c8ee4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommitMessageSummary

func CommitMessageSummary(message string) string

CommitMessageSummary returns the summary of the commit message according to the usual guidelines (see https://chris.beams.io/posts/git-commit/, "Limit the subject line to 50 characters")

func DetectModuleSharedDataDirectory

func DetectModuleSharedDataDirectory(moduleName string) (string, error)

DetectModuleSharedDataDirectory detects the directory where QMSTR's shared data is stored.

func DetectSharedDataDirectory

func DetectSharedDataDirectory() (string, error)

DetectSharedDataDirectory detects the shared data directory for all of QMSTR. It looks for /usr/share/qmstr, /usr/local/share/qmstr and /opt/share/qmstr, in that order.

func GetBOM

func GetBOM(pkg *service.PackageNode, enableWarnings bool, enableErrors bool) (*service.BOM, error)

func ShortenedVersionIdentifier

func ShortenedVersionIdentifier(message string) string

ShortenedVersionIdentifier calculates shortened version of the version identifier, in upper-case characters

Types

type PackageData

type PackageData struct {
	PackageName         string // The package name, e.g. "CURL" or "Linux"
	BuildConfig         string // The name of the build configuration e.g. "amd_64_something"
	Vendor              string // Name of the entity distributing this package
	OcFossLiaison       string // Name of the FOSS liaison function
	OcComplianceContact string // Email address acting as the general FOSS compliance contact for the vendor
	LicenseDeclared     string
	Targets             []*service.Target
	Site                *SiteData // The site this page is associated with
}

PackageData is the package metadata that the report will visualize. PackageData is expected to stay more or less constant across versions of the package. oc... refers to OpenChain related fields

func GetPackageData

func GetPackageData(bom *service.BOM, siteData *SiteData) *PackageData

GetPackageData extracts the package data from the given BOM

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter contains the fields provided to every report

func NewReporter

func NewReporter(module ReporterModule) *Reporter

NewReporter creates a new reporter.

func (*Reporter) GetModuleName

func (r *Reporter) GetModuleName() string

GetModuleName returns the module name

func (*Reporter) RunReporterModule

func (r *Reporter) RunReporterModule() error

RunReporterModule is the main driver function for each reporter.

type ReporterModule

type ReporterModule interface {
	Configure(configMap map[string]string) error
	Report(cserv service.ControlServiceClient, rserv service.ReportServiceClient) error
	PostReport() error
}

ReporterModule defines the methods required to implement a reporter.

type RevisionData

type RevisionData struct {
	VersionIdentifier string       // Usually a Git hash, but any string can be used
	ChangeDateTime    string       // The change timestamp
	Author            string       // The author of the change
	Message           string       // The commit message
	Package           *PackageData // The package this version is associated with.
}

RevisionData contains metadata about a specific revision.

func GetRevisionData

func GetRevisionData(bom *service.BOM, packageData *PackageData) *RevisionData

GetRevisionData extracts the revision data from the BOM

type SiteData

type SiteData struct {
	Provider string // the responsible entity running the site
}

SiteData contains information about this Quartermaster site.

func GetSiteDataFromConfiguration

func GetSiteDataFromConfiguration(config map[string]string) (*SiteData, error)

GetSiteDataFromConfiguration extracts the site provider informatiom from the configuration

Jump to

Keyboard shortcuts

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