detector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(data io.Reader, classifier *licenseclassifier.License, rules *Rules, overrides dependency.Overrides, includeIndirect bool) (*dependency.List, error)

Detect searches the dependencies on disk and detects licences.

func NewClassifier

func NewClassifier(dataPath string) (*licenseclassifier.License, error)

NewClassifier creates a new instance of the licence classifier.

Types

type Rules

type Rules struct {
	WhiteList map[string]struct{}
}

Rules holds rules for the detector.

func LoadRules

func LoadRules(path string) (*Rules, error)

LoadRules loads rules from the given path. Embedded rules file is loaded if the path is empty.

func (*Rules) IsAllowed

func (r *Rules) IsAllowed(licenceID string) bool

IsAllowed returns true if the given licence is allowed by the rules.

Jump to

Keyboard shortcuts

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