modules

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Main      bool         // is this the main module?
	Indirect  bool         // is it an indirect dependency?
	Path      string       // module path
	Replace   *Module      // replaced by this module
	Version   string       // module version
	Time      *time.Time   // time version was created
	Update    *Module      // available update, if any (with -u)
	GoMod     string       // the path to this module's go.mod file
	GoVersion string       // the Go version associated with the module
	Error     *ModuleError // error loading module
}

Module represents the data returned by 'go list -m --json' for a Go module.

func GetDependencies

func GetDependencies(logger *logrus.Logger, moduleDir string) (*Module, map[string]*Module, error)

Retrieve the Module information for all dependencies of the Go module found at the specified path.

func GetDependenciesWithUpdates

func GetDependenciesWithUpdates(logger *logrus.Logger, moduleDir string) (*Module, map[string]*Module, error)

Retrieve the Module information for all dependencies of the Go module found at the specified path, including any potentially available updates. This requires internet connectivity in order to return the results. Lack of connectivity should result in an error being returned but this is not a hard guarantee.

func GetModule

func GetModule(logger *logrus.Logger, moduleDir string, targetModule string) (*Module, error)

Retrieve the Module information for the specified target module which must be a dependency of the Go module found at the specified path.

func GetModuleWithUpdate

func GetModuleWithUpdate(logger *logrus.Logger, moduleDir string, targetModule string) (*Module, error)

Retrieve the Module information for the specified target module which must be a dependency of the Go module found at the specified path, including any potentially available updates. This requires internet connectivity in order to return the results. Lack of connectivity should result in an error being returned but this is not a hard guarantee.

type ModuleError

type ModuleError struct {
	Err string // the error itself
}

ModuleError represents the data that is returned whenever Go tooling was unable to load a given module's information.

Jump to

Keyboard shortcuts

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