classifier

package
v0.0.0-...-4d39eab Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend is an object that handles classifying a license.

func NewBackend

func NewBackend() (*Backend, error)

New creates a new backend working on the local filesystem.

func (*Backend) ClassifyLicenses

func (b *Backend) ClassifyLicenses(filenames []string) (errors []error)

ClassifyLicenses runs the license classifier over the given file.

func (*Backend) ClassifyLicensesWithContext

func (b *Backend) ClassifyLicensesWithContext(ctx context.Context, filenames []string) (errors []error)

ClassifyLicensesWithContext runs the license classifier over the given file; ensure that it will respect the timeout in the provided context.

func (*Backend) GetResults

func (b *Backend) GetResults() results.LicenseTypes

GetResults returns the results of the classifications.

type BackendInterface

type BackendInterface interface {
	ClassifyLicenses(filenames []string, headers bool) []error
	ClassifyLicensesWithContext(ctx context.Context, filenames []string, headers bool) []error
	GetResults() results.LicenseTypes
}

BackendInterface is the interface each backend must implement.

type Classifier

type Classifier struct {
	// contains filtered or unexported fields
}

func New

func New(configFile string, fileNames []string) *Classifier

func (*Classifier) Process

func (c *Classifier) Process(ctx context.Context, vendorPath string, outputPath string) error

type Dir

type Dir struct {
	// contains filtered or unexported fields
}

func (Dir) String

func (d Dir) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL