matcher

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLicenseFromDetector

func GetLicenseFromDetector(licenseTxt string, licSha string) []string

GetLicenseFromDetector check license from detector

func GetPomCommentLicense

func GetPomCommentLicense(pomTxt string) string

GetPomCommentLicense read licenses which presented as a comment in the pom file

Types

type DiscoveryFiler

type DiscoveryFiler struct {
	LicenseContent string
}

DiscoveryFiler license object

func (DiscoveryFiler) Close

func (df DiscoveryFiler) Close()

Close close license file

func (DiscoveryFiler) PathsAreAlwaysSlash

func (df DiscoveryFiler) PathsAreAlwaysSlash() bool

PathsAreAlwaysSlash check if path has slash

func (DiscoveryFiler) ReadDir

func (df DiscoveryFiler) ReadDir(path string) ([]filer.File, error)

ReadDir read license directory

func (DiscoveryFiler) ReadFile

func (df DiscoveryFiler) ReadFile(path string) (content []byte, err error)

ReadFile read license file

type LicenseDiscover

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

LicenseDiscover object

func NewLicenseMatcher

func NewLicenseMatcher(licensesFolder string) (*LicenseDiscover, error)

NewLicenseMatcher read licenses db and instantiate the classifier

func (LicenseDiscover) MatchLicenseTxt

func (ld LicenseDiscover) MatchLicenseTxt(licenseTxt string) []string

MatchLicenseTxt try to match license txt to known spdx license 1st try to match to license classifier and then to license detector

Jump to

Keyboard shortcuts

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