Documentation ¶
Overview ¶
Package backend contains the necessary functions to classify a license.
Index ¶
- type ClassifierBackend
- func (b *ClassifierBackend) ClassifyLicenses(numTasks int, filenames []string, headers bool) (errors []error)
- func (b *ClassifierBackend) ClassifyLicensesWithContext(ctx context.Context, numTasks int, filenames []string, headers bool) (errors []error)
- func (b *ClassifierBackend) Close()
- func (b *ClassifierBackend) GetResults() results.LicenseTypes
- func (b *ClassifierBackend) SetTraceConfiguration(tc *classifier.TraceConfiguration)
- 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() (*ClassifierBackend, error)
New creates a new backend working on the local filesystem.
func (*ClassifierBackend) ClassifyLicenses ¶
func (b *ClassifierBackend) ClassifyLicenses(numTasks int, 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, numTasks int, filenames []string, headers bool) (errors []error)
ClassifyLicensesWithContext runs the license classifier over the given file; ensure that it will respect the timeout 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.
func (*ClassifierBackend) SetTraceConfiguration ¶
func (b *ClassifierBackend) SetTraceConfiguration(tc *classifier.TraceConfiguration)
SetTraceConfiguration injects the supplied trace configuration
type ClassifierInterface ¶
type ClassifierInterface interface { Close() SetTraceConfiguration(tc *classifier.TraceConfiguration) ClassifyLicenses(numTasks int, filenames []string, headers bool) []error ClassifyLicensesWithContext(ctx context.Context, numTasks int, filenames []string, headers bool) []error GetResults() results.LicenseTypes }
ClassifierInterface is the interface each backend must implement.