lic

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefinitionFormat

func DefinitionFormat(definition string) string

DefinitionFormat is a simple regex used to format license definitions for comparison.

func InitLicense

func InitLicense(gopath string) (licenses, error)

InitLicense creates a Licenses map using the data stored in DefinedJson.

func TestLicense

func TestLicense(licDef string, def definedLicense, debug bool) (matchesAll bool)

TestLicense is a function to help track down the differences between a license file and one of the defined licenses.

Types

type Launch

type Launch struct {
	Repo             string
	Dst              string
	Version          string
	CleanupMod       bool
	CleanupClone     bool
	ToHTML           bool
	GitCheck         bool
	Gopath           string
	ModPath          string
	CurrentDownloads map[string]struct{}
	Scanner          Scanner
}

Launch is a struct that holds all necessary info used to start the program and scan.

func (*Launch) LaunchProgram

func (l *Launch) LaunchProgram() error

LaunchProgram is the root of the program. It starts all processes declared by the Command Line Args.

type Scanner

type Scanner struct {
	Gopath            string
	ModPath           string
	DstPath           string
	ProjectSum        string
	LicFolder         string
	GitUser           string
	GitToken          string
	GitLicense        string // License for current repo from github.
	ToHTML            bool
	Licensecanned     bool
	Template          *template.Template
	CompletedApiCheck completedApiCheck
	Exclusions        exclusions
	ExcludedEXT       excludedEXT
	Inclusions        inclusions
	Override          overrides
	Licenses          licenses
	LicenseType       map[string][]licenseInfo
}

The Scanner struct is the main object we use for our FileWalk and ScanPath. It holds all the paths maps and other things we need.

func (*Scanner) ScanPath

func (s *Scanner) ScanPath() error

ScanPath scans the path entered in and starts the process of copying and classifying license files into LicFolder. They will be .html files if the -tohtml Command Line Arg is used. In addition if a -git-token and -git-user is provided the program will check the api and provide the current github license. This will make the program wait a second everytime it is called.

Jump to

Keyboard shortcuts

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