package old

Import Path
	github.com/google/licensecheck/old (on go.dev)

Dependency Relation
	imports 6 packages, and imported by 2 packages

Involved Source Files data.gen.go Package old is an old (v0.1.0) copy of the licensecheck package, for easier comparison with the new Scan API. normalize.go type_string.go urls.go
Package-Level Type Names (total 11, in which 6 are exported)
/* sort exporteds by: | */
A Checker matches a set of known licenses. Cover is like the top-level function Cover, but it uses the set of licenses in the Checker instead of the built-in license set. func New(licenses []License) *Checker
Coverage describes how the text matches various licenses. Match describes, in sequential order, the matches of the input text across the various licenses. Typically it will be only one match long, but if the input text is a concatenation of licenses it will contain a match value for each element of the concatenation. Percent is the fraction of the total text, in normalized words, that matches any valid license, expressed as a percentage across all of the licenses matched. func Cover(input []byte, opts Options) (Coverage, bool) func (*Checker).Cover(input []byte, opts Options) (Coverage, bool)
A License describes a single license that can be recognized. At least one of the Text or the URL should be set. Name string Text string URL string func BuiltinLicenses() []License func New(licenses []License) *Checker
Match describes how a section of the input matches a license. // The byte offset of the end of the last word in the input that matches. IsURL reports that the matched text identifies a license by indirection through a URL. If set, Start and End specify the location of the URL itself, and Percent is always 100.0. // The (file) name of the license it matches. // The fraction of words between Start and End that are matched. // The byte offset of the first word in the input that matches. // The type of the license: BSD, MIT, etc.
Options allow us to adjust parameters for the matching algorithm. TODO: Delete this once the package has been fine-tuned. // Minimum length of run, in words, to count as a matching substring. // Maximum allowable gap in a near-contiguous match. // Percentage threshold to report a match. func Cover(input []byte, opts Options) (Coverage, bool) func (*Checker).Cover(input []byte, opts Options) (Coverage, bool)
Type groups the licenses into various classifications. TODO: This list is clearly incomplete. ( T) String() string T : expvar.Var T : fmt.Stringer const AGPL const Apache const BSD const CC const GPL const JSON const MIT const NumTypes const Other const Unlicense const Zlib
Package-Level Functions (total 9, in which 3 are exported)
BuiltinLicenses returns the list of licenses built into the package. That is, the built-in checker is equivalent to New(BuiltinLicenses()).
Cover computes the coverage of the text according to the license set compiled into the package. An input text may match multiple licenses. If that happens, Match contains only disjoint matches. If multiple licenses match a particular section of the input, the best match is chosen so the returned coverage describes at most one match for each section of the input.
New returns a new Checker that recognizes the given list of licenses.
Package-Level Variables (total 8, none are exported)
Package-Level Constants (total 504, in which 11 are exported)