deps

package
v0.0.0-...-038d724 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	Unknown string = "Unknown"
)

Variables

View Source
var Resolvers = []Resolver{
	new(GoModeResolver),
}

Functions

func Resolve

func Resolve(config *ConfigDeps, report *Report) error

Types

type ConfigDeps

type ConfigDeps struct {
	Files []string `yaml:"files"`
}

func (*ConfigDeps) Finalize

func (config *ConfigDeps) Finalize(configFile string) error

type GoModeResolver

type GoModeResolver struct {
	Resolver
}

func (*GoModeResolver) CanResolve

func (resolver *GoModeResolver) CanResolve(file string) bool

func (*GoModeResolver) Resolve

func (resolver *GoModeResolver) Resolve(goModFile string, report *Report) error

Resolve resolves licenses of all dependencies declared in the go.mod file.

func (*GoModeResolver) ResolvePackageLicense

func (resolver *GoModeResolver) ResolvePackageLicense(p *packages.Package, report *Report) error

func (*GoModeResolver) ResolvePackages

func (resolver *GoModeResolver) ResolvePackages(pkgNames []string, report *Report) error

ResolvePackages resolves the licenses of the given packages.

type Report

type Report struct {
	Resolved []*Result
	Skipped  []*Result
}

Report is a collection of resolved Result.

func (*Report) Resolve

func (report *Report) Resolve(result *Result)

Resolve marks the dependency's license is resolved.

func (*Report) Skip

func (report *Report) Skip(result *Result)

Skip marks the dependency's license is skipped for some reasons.

func (*Report) String

func (report *Report) String() string

type Resolver

type Resolver interface {
	CanResolve(string) bool
	Resolve(string, *Report) error
}

type Result

type Result struct {
	Dependency      string
	LicenseFilePath string
	LicenseContent  string
	LicenseSpdxID   []string
}

Result is a single item that represents a resolved dependency license.

type SpdxID

type SpdxID string

Jump to

Keyboard shortcuts

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