licenses

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileNames

func FileNames() []string
func Search(ctx context.Context, scanner Scanner, reader file.LocationReadCloser) (licenses []pkg.License, err error)

Search scans the contents of a license file to attempt to determine the type of license it is

func SetContextLicenseScanner added in v1.14.2

func SetContextLicenseScanner(ctx context.Context, s Scanner) context.Context

Types

type Scanner added in v1.14.2

type Scanner interface {
	IdentifyLicenseIDs(context.Context, io.Reader) ([]string, error)
}

func ContextLicenseScanner added in v1.14.2

func ContextLicenseScanner(ctx context.Context) Scanner

func NewDefaultScanner added in v1.14.2

func NewDefaultScanner() Scanner

NewDefaultScanner returns a scanner that uses a new instance of the default licensecheck package scanner.

func TestingOnlyScanner added in v1.14.2

func TestingOnlyScanner() Scanner

TestingOnlyScanner returns a scanner that uses the built-in license scanner from the licensecheck package. THIS IS ONLY MEANT FOR TEST CODE, NOT PRODUCTION CODE.

Jump to

Keyboard shortcuts

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