Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoLicenseFound is raised if no license files were found. ErrNoLicenseFound = errors.New("no license file was found") )
Functions ¶
func Detect ¶
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.
func InvestigateLicenseText ¶
InvestigateLicenseText takes the license text and returns the most probable reference licenses matched. Each match has the confidence assigned, from 0 to 1, 1 means 100% confident.
func Preload ¶
func Preload()
Preload database with licenses - load internal database from assets into memory. This method is an optimization for cases when the `Detect` method should return fast, e.g. in HTTP web servers where connection timeout can occur during detect `Preload` method could be called before server startup. This method os optional and it's not required to be called, other APIs loads license database lazily on first invocation.
Types ¶
type Match ¶
type Match struct { License string `json:"license"` Confidence float32 `json:"confidence"` File string `json:"file"` }
Match describes the level of confidence for the detected License