reporting

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

type PackageData

type PackageData struct {
	Name            string
	Version         string // Usually a Git hash, but any string can be used
	LicenseDeclared string
	Targets         []*Target
	Project         string // The project this package is associated with.
}

PackageData contains metadata about a specific package.

func GetPackageData

func GetPackageData(pkg *module.PackageNodeProxy, projectName string) (*PackageData, error)

func (*PackageData) GetAuthors

func (p *PackageData) GetAuthors() []string

func (*PackageData) GetLicenses

func (p *PackageData) GetLicenses() []string

func (*PackageData) MarshalJSON

func (p *PackageData) MarshalJSON() ([]byte, error)

type ProjectData

type ProjectData struct {
	Name                string    // The project name, e.g. "CURL" or "Linux"
	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
	Site                *SiteData // The site this page is associated with
}

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

func GetProjectData

func GetProjectData(proj *service.ProjectNode, siteData *SiteData) *ProjectData

type Reporter

type Reporter struct {
	module.MasterClient
	// contains filtered or unexported fields
}

Reporter contains the fields provided to every report

func NewReporter

func NewReporter(repModule 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(masterClient *module.MasterClient) error
	PostReport() error
}

ReporterModule defines the methods required to implement a reporter.

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

type Target

type Target struct {
	Target   *service.FileNode
	Licenses []string
	Authors  []string
}

Jump to

Keyboard shortcuts

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