module

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DiffWeightLow difference with low severity
	DiffWeightLow = DiffLevel(iota)
	//DiffWeightMedium difference with medium severity
	DiffWeightMedium
	//DiffWeightHigh difference with high severity
	DiffWeightHigh
	//DiffWeightCritical difference with critical severity
	DiffWeightCritical
)
View Source
const (
	//DiffTypeModuleFetchError error during module fetch
	DiffTypeModuleFetchError = DiffType(iota)
	//DiffTypeLicenseNotFound license not found
	DiffTypeLicenseNotFound
	//DiffTypeLicenseAdded license added
	DiffTypeLicenseAdded
	//DiffTypeLicenseMinorChanges minor changes in license
	DiffTypeLicenseMinorChanges
	//DiffTypeLicenseNameChanged changed license name
	DiffTypeLicenseNameChanged
	//DiffTypeLicenseLessStrictChanged changed license to less strict
	DiffTypeLicenseLessStrictChanged
	//DiffTypeLicenseMoreStrictChanged  changed license to more strict
	DiffTypeLicenseMoreStrictChanged
	//DiffTypeLicenseRemoved license removed
	DiffTypeLicenseRemoved
	//DiffTypeNewSubmodule new submodule
	DiffTypeNewSubmodule
	//DiffTypeNewVulnerability new vulnerability
	DiffTypeNewVulnerability
)

Variables

This section is empty.

Functions

func InitHandler

func InitHandler(exc *executor.Executor) *handler

InitHandler initializes Module handler

Types

type Details

type Details struct {
	Dependencies      []Module
	DependenciesMap   map[string]Module
	License           license.License
	UpdateDifferences Differences
	Vulnerabilities   vulnerability.Vulnerabilities
}

Details contains additional information about module

type DiffLevel added in v0.8.0

type DiffLevel uint16

type DiffType added in v0.8.0

type DiffType uint16

type Difference

type Difference struct {
	Level         DiffLevel
	Module        Module
	ModuleUpdate  Module
	Type          DiffType
	Vulnerability vulnerability.Vulnerability
}

Difference contains differences between module versions

type Differences

type Differences []Difference

Differences contains multiple differences

func (*Differences) AddModule

func (dffs *Differences) AddModule(md Module, dfLv DiffLevel, dfTp DiffType)

AddModule adds difference of module

func (*Differences) AddModules added in v0.7.0

func (dffs *Differences) AddModules(md, mdUp Module, dfLv DiffLevel, dfTp DiffType)

AddModules adds difference details with module and available update

func (*Differences) AddVulnerability added in v0.7.0

func (dffs *Differences) AddVulnerability(md Module, vln vulnerability.Vulnerability)

AddVulnerability adds difference of vulnerability

type Error added in v0.7.0

type Error struct {
	Err string
}

Error represents the error when a module cannot be loaded

type Handler

type Handler interface {
	ListAvailable(direct, withUpdate bool) (Modules, output.Output)
	ListSubModules(pth string) (Modules, output.Output)
}

Handler handles functions related to modules

type Module

type Module struct {
	Main      bool     `json:",omitempty"` // is this the main module?
	Indirect  bool     `json:",omitempty"` // module is only indirectly needed by main module
	Dir       string   `json:",omitempty"` // directory holding local copy of files, if any
	GoMod     string   `json:",omitempty"` // path to go.mod file describing module, if any
	GoVersion string   `json:",omitempty"` // go version used in module
	Path      string   `json:",omitempty"` // module path
	Version   string   `json:",omitempty"` // module version
	Versions  []string `json:",omitempty"` // available module versions
	Error     *Error   `json:",omitempty"` // error loading module
	Replace   *Module  `json:",omitempty"` // replaced by this module
	Update    *Module  `json:",omitempty"` // available update
	Details
}

Module holds information about a specific module

func (Module) HasUpdate

func (md Module) HasUpdate() bool

HasUpdate checks if module has an update

func (Module) NewModule

func (md Module) NewModule() string

NewModule returns the path and version of the update taking in account any Replace settings

func (Module) PathCleaned

func (md Module) PathCleaned() string

PathCleaned cleans module path

func (Module) String

func (md Module) String() string

String returns the path and version of current module

type Modules

type Modules []Module

Modules contains collections of Modules

func (*Modules) SelectCLI

func (mds *Modules) SelectCLI() error

SelectCLI allows interactively select modules to update

type Table added in v0.8.0

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

func NewTable added in v0.8.0

func NewTable() Table

func (*Table) GenerateAnalyzeTable added in v0.8.0

func (tbl *Table) GenerateAnalyzeTable(mds Modules, vln bool) string

GenerateAnalyzeTable generates a table for CLI with analyze of current dependencies

func (Table) GeneratePreviewTable added in v0.8.0

func (tbl Table) GeneratePreviewTable(mds Modules) string

GeneratePreviewTable generates a table for CLI with available updates

Jump to

Keyboard shortcuts

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