list

package
v0.0.0-...-5c4efe0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateModule = errors.New(
	"this module conflicts with another one that declares the same path")
View Source
var ErrDuplicateProvides = errors.New(
	"the provided module path has already been declared")
View Source
var ErrIgnoredModule = errors.New(
	"the user requested to ignore this module path")
View Source
var ErrSeenModule = errors.New("this module was already scanned")

Taking only module into account: we do not allow several versions of the same module path within a single source directory, because a source directory is associated with a single project version

View Source
var ErrUnknownOutputFormat = errors.New("unknown output format")

Functions

func BuildRequires

func BuildRequires(sources []string, ver *version.Version,
	includeMods []string, ignoreMods []string,
	output string, outputFormat string, quiet bool,
) (results descriptor.Requires, written write.Files,
	err error)

func Descriptor

func Descriptor(info modfiles.ModFiles, ver *version.Version,
	addUnknownModules bool, modules map[string]bool,
	results *Results, onlydescr bool, walksubs bool, quiet bool,
) (err error)

Walks a module tree, identified by its modfiles.ModFiles info

func Module

func Module(root string, ver *version.Version, addUnknownModules bool,
	modules map[string]bool, results *Results,
	onlydescr bool, quiet bool) error

Walks a module tree to list its constituant files,

func PathRequires

func PathRequires(sources []string, includeMods []string, ignoreMods []string,
	output string, outputFormat string, quiet bool,
) (results descriptor.Requires, written write.Files, err error)

func Requires

func Requires(sources []string, includeMods []string, ignoreMods []string,
	output string, outputFormat string, quiet bool,
) (results descriptor.Requires, written write.Files, err error)

func TryModule

func TryModule(path string, quiet bool) (result modfiles.ModFiles, err error)

Check if a file path is a valid module descriptor; return a modfiles.ModFiles struct if true. The Files part of the result struct is not populated and needs separate walking

Types

type Results

type Results struct {
	sync.RWMutex
	Modules map[string]*modfiles.ModFiles
}

func Discover

func Discover(sources []string,
	includeMods []string, ignoreMods []string, onlyRoot bool,
	output string, outputFormat string, quiet bool,
) (results *Results, written write.Files, err error)

func Provides

func Provides(sources []string, ver *version.Version,
	includeMods []string, ignoreMods []string,
	onlyName bool, onlyVersion bool,
	output string, outputFormat string, quiet bool,
) (results *Results, written write.Files, err error)

func Scan

func Scan(sources []string, ver *version.Version,
	includeMods []string, ignoreMods []string,
	onlydescr bool, quiet bool,
) (results *Results, err error)

Walks sources to find and read Go module source trees within

func (*Results) BuildRequires

func (modules *Results) BuildRequires(quiet bool,
) (results descriptor.Requires,
	err error)

func (*Results) CSV

func (modules *Results) CSV(onlyRoot bool) string

func (*Results) Format

func (modules *Results) Format(format string, onlyRoot bool) (string, error)

func (*Results) JSON

func (modules *Results) JSON() (string, error)

func (*Results) List

func (modules *Results) List(separator string, onlyRoot bool,
) (results string)

func (*Results) Provides

func (modules *Results) Provides(quiet bool) (results descriptor.Provides,
	err error)

func (*Results) Requires

func (modules *Results) Requires(quiet bool) (descriptor.Requires, error)

func (*Results) Text

func (modules *Results) Text(onlyRoot bool) string

Jump to

Keyboard shortcuts

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