Documentation ¶
Overview ¶
Package backend contains the necessary functions to classify a license.
Index ¶
- type ClassifierBackend
- func (b *ClassifierBackend) ClassifyLicenses(filenames []string, headers bool) (errors []error)
- func (b *ClassifierBackend) ClassifyLicensesWithContext(ctx context.Context, filenames []string, headers bool) (errors []error)
- func (b *ClassifierBackend) Close()
- func (b *ClassifierBackend) GetResults() results.LicenseTypes
- type ClassifierInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClassifierBackend ¶
type ClassifierBackend struct {
// contains filtered or unexported fields
}
ClassifierBackend is an object that handles classifying a license.
func New ¶
func New(threshold float64, forbiddenOnly bool) (*ClassifierBackend, error)
New creates a new backend working on the local filesystem.
func (*ClassifierBackend) ClassifyLicenses ¶
func (b *ClassifierBackend) ClassifyLicenses(filenames []string, headers bool) (errors []error)
ClassifyLicenses runs the license classifier over the given file.
func (*ClassifierBackend) ClassifyLicensesWithContext ¶
func (b *ClassifierBackend) ClassifyLicensesWithContext(ctx context.Context, filenames []string, headers bool) (errors []error)
ClassifyLicensesWithContext runs the license classifier over the given file; ensure that it will respect the timeout and cancelation in the provided context.
func (*ClassifierBackend) Close ¶
func (b *ClassifierBackend) Close()
Close does nothing here since there's nothing to close.
func (*ClassifierBackend) GetResults ¶
func (b *ClassifierBackend) GetResults() results.LicenseTypes
GetResults returns the results of the classifications.
type ClassifierInterface ¶
type ClassifierInterface interface { Close() ClassifyLicenses(filenames []string, headers bool) []error ClassifyLicensesWithContext(ctx context.Context, filenames []string, headers bool) []error GetResults() results.LicenseTypes }
ClassifierInterface is the interface each backend must implement.
Click to show internal directories.
Click to hide internal directories.