licensei

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAggregatedDependencySource added in v0.1.0

func NewAggregatedDependencySource(logger *slog.Logger) *aggregatedDependencySource

func NewCacheProjectSource

func NewCacheProjectSource(delegatedDependencySource dependencySource, logger *slog.Logger) *cacheDependencySource

func NewDepDependencySource

func NewDepDependencySource() *depDependencySource

func NewGoModDependencySource added in v0.1.0

func NewGoModDependencySource(logger *slog.Logger) *gomodDependencySource

func NewJSONListView added in v0.2.0

func NewJSONListView(output io.Writer) *jsonListView

NewJSONListView returns a view that outputs a license list as JSON.

func NewTableListView

func NewTableListView(output io.Writer) *tableListView

NewTableListView returns a view that outputs a license list as JSON.

func WriteCache

func WriteCache(w io.Writer, dependencies []Dependency) error

WriteCache writes the generated cache to file.

Types

type Dependency

type Dependency struct {
	Name       string  `toml:"name"`
	Revision   string  `toml:"revision"`
	License    string  `toml:"license"`
	Confidence float32 `toml:"confidence"`
	Type       string  `toml:"type"`
}

func ReadCache

func ReadCache(r io.Reader) ([]Dependency, error)

ReadCache reads the cache from file.

type HeaderChecker added in v0.2.0

type HeaderChecker struct {
	IgnorePaths []string
	IgnoreFiles []string
	Authors     []string
}

func (HeaderChecker) Check added in v0.2.0

func (c HeaderChecker) Check(root string, template string) (HeaderViolations, error)

nolint: gocognit

type HeaderViolations added in v0.2.0

type HeaderViolations map[string]string

type LicenseDetector

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

func NewLicenseDetector

func NewLicenseDetector(githubToken string, logger *slog.Logger) *LicenseDetector

func (*LicenseDetector) Detect

func (d *LicenseDetector) Detect(dependencies []Dependency) ([]Dependency, error)

type ListDependencyItem

type ListDependencyItem struct {
	Name       string  `json:"name"`
	License    string  `json:"license"`
	Confidence float32 `json:"confidence"`
}

ListDependencyItem represents an item in the list view.

type ListViewModel

type ListViewModel struct {
	Dependencies []ListDependencyItem `json:"dependencies"`
}

ListViewModel holds information for a list view.

Jump to

Keyboard shortcuts

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