licensedb

package
v3.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoLicenseFound is raised if no license files were found.
	ErrNoLicenseFound = errors.New("no license file was found")
)

Functions

func Detect

func Detect(fs filer.Filer) (map[string]api.Match, error)

Detect returns the most probable reference licenses matched for the given file tree. Each match has the confidence assigned, from 0 to 1, 1 means 100% confident.

Types

type Match

type Match struct {
	License    string  `json:"license"`
	Confidence float32 `json:"confidence"`
}

Match describes the level of confidence for the detected License

type Result

type Result struct {
	Arg     string  `json:"project,omitempty"`
	Matches []Match `json:"matches,omitempty"`
	ErrStr  string  `json:"error,omitempty"`
}

Result gathers license detection results for a project path

func Analyse

func Analyse(args ...string) []Result

Analyse runs license analysis on each item in `args`

Directories

Path Synopsis
wmh

Jump to

Keyboard shortcuts

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