Documentation
¶
Index ¶
- Constants
- Variables
- func Cli(pkgs, depsToSkip []string) *cobra.Command
- func CliAllPackages(depsToSkip []string) (*cobra.Command, error)
- func CommonOverrides(pkg, candidate string) string
- func GetTemplatesSet() (map[string]interface{}, error)
- func PrintLicenses() error
- func PrintLicensesWithOptions(opts *Options) error
- type CliOptions
- type GlooProductLicenseHandler
- type License
- type LicenseValidator
- type MatchResult
- type MissingError
- type Options
- type PkgError
- type PkgInfo
- type Product
- type Template
- type Word
Constants ¶
View Source
const ( SkipLicenses = "skipLicenses" IncludeLicenses = "includeLicenses" CheckLicenses = "checkLicenses" )
View Source
const ( MITForm = "MIT License" Apache2_0Form = "Apache License 2.0" )
Variables ¶
View Source
var CommonReplacements = []string{
"k8s.io", "github.com/kubernetes",
"golang.org/x", "github.com/golang",
"go.uber.org", "github.com/uber-go",
"cloud.google.com/go", "github.com/googleapis/google-cloud-go",
"google.golang.org/grpc", "github.com/grpc/grpc-go",
"istio.io", "github.com/istio",
"contrib.go.opencensus.io/exporter/prometheus", "github.com/census-ecosystem/opencensus-go-exporter-prometheus",
"google.golang.org/genproto", "github.com/googleapis/go-genproto",
"sigs.k8s.io", "github.com/kubernetes-sigs",
"knative.dev", "github.com/knative",
}
Functions ¶
func Cli ¶ added in v0.0.4
examines licenses of dependencies for any package in the pkgs array dependencies that are in depsToSkip are not analyzed (for example, github.com/mitchellh/go-homedir which is needed in mac but not linux)
func CliAllPackages ¶ added in v0.0.6
`go list -e ./...` is run to determine all packages necessary to examine the dependencies of
func CommonOverrides ¶
func GetTemplatesSet ¶
func PrintLicenses ¶
func PrintLicenses() error
Types ¶
type CliOptions ¶ added in v0.0.4
type GlooProductLicenseHandler ¶ added in v0.0.4
type GlooProductLicenseHandler struct { LicensesToProcess map[string]interface{} DependenciesToSkip []string }
func NewGlooProductLicenseHandler ¶ added in v0.0.4
func NewGlooProductLicenseHandler(depsToSkip []string, licensesToProcess map[string]interface{}) *GlooProductLicenseHandler
func (*GlooProductLicenseHandler) ExtraLicenses ¶ added in v0.0.4
func (lh *GlooProductLicenseHandler) ExtraLicenses() []License
func (*GlooProductLicenseHandler) OverrideLicense ¶ added in v0.0.4
func (lh *GlooProductLicenseHandler) OverrideLicense(pkg, licenseCandidate string) string
func (*GlooProductLicenseHandler) ReplacementList ¶ added in v0.0.4
func (lh *GlooProductLicenseHandler) ReplacementList() []string
func (*GlooProductLicenseHandler) SkipLicense ¶ added in v0.0.4
func (lh *GlooProductLicenseHandler) SkipLicense(l License) bool
type License ¶
type License struct { Package string Score float64 Template *Template Path string // ManualPath indicates the URI of the license file. If provided, overrides the auto-generated URI path ManualPath string Err string ExtraWords []string MissingWords []string // text from the license file FileContent []byte }
type LicenseValidator ¶ added in v0.0.4
type LicenseValidator struct {
// contains filtered or unexported fields
}
func NewLicenseValidator ¶ added in v0.0.4
func NewLicenseValidator() (*LicenseValidator, error)
type MatchResult ¶
type MissingError ¶
type MissingError struct {
Err string
}
func (*MissingError) Error ¶
func (err *MissingError) Error() string
type Product ¶
type Product interface { // determines if a license should be skipped // sample reason for skipping: a library is only used on MacOS, not in Linux, which is the environment of the deployed process SkipLicense(license License) bool // This library generates license lists from binary dependencies but may exclude some external dependencies (such as EnvoyProxy) ExtraLicenses() []License // Replacements returns an even-length list of strings representing an old and new string ReplacementList() []string // If the automated tool is unable to correctly categorize a license you can override it with this function OverrideLicense(pkg, license string) string }
Click to show internal directories.
Click to hide internal directories.