licensedb

package
Version: v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 10

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]float32, 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