Documentation
¶
Index ¶
- Variables
- func BuildRequires(sources []string, ver *version.Version, includeMods []string, ...) (descriptor.Requires, write.Files, string, error)
- func Descriptor(info modfiles.ModFiles, ver *version.Version, addUnknownModules bool, ...) error
- func Module(root string, ver *version.Version, addUnknownModules bool, ...) error
- func PathRequires(sources []string, includeMods []string, ignoreMods []string, output string, ...) (descriptor.Requires, write.Files, string, error)
- func Requires(sources []string, includeMods []string, ignoreMods []string, output string, ...) (descriptor.Requires, write.Files, string, error)
- func TryModule(path string) (result modfiles.ModFiles, err error)
- type Results
- func Discover(sources []string, includeMods []string, ignoreMods []string, onlyRoot bool, ...) (*Results, write.Files, string, error)
- func Provides(sources []string, ver *version.Version, includeMods, ignoreMods []string, ...) (*Results, write.Files, string, error)
- func Scan(sources []string, ver *version.Version, includeMods []string, ...) (*Results, error)
- func (modules *Results) BuildRequires() (descriptor.Requires, error)
- func (modules *Results) CSV(onlyRoot bool) string
- func (modules *Results) Format(format string, onlyRoot bool) (string, error)
- func (modules *Results) JSON() (string, error)
- func (modules *Results) List(separator string, onlyRoot bool) string
- func (modules *Results) Provides() (descriptor.Provides, error)
- func (modules *Results) Requires() (descriptor.Requires, error)
- func (modules *Results) Text(onlyRoot bool) string
Constants ¶
This section is empty.
Variables ¶
var ( ErrSeenModule = errors.New("this module was already scanned") ErrDuplicateModule = errors.New( "this module conflicts with another one that declares the same path", ) ErrIgnoredModule = errors.New("the user requested to ignore this module path") ErrUnknownOutputFormat = errors.New("unknown output format") ErrDuplicateProvides = errors.New( "the provided module path has already been declared", ) )
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
Functions ¶
func BuildRequires ¶
func BuildRequires( sources []string, ver *version.Version, includeMods []string, ignoreMods []string, output string, outputFormat string, ) (descriptor.Requires, write.Files, string, error)
Retrieves the build dependencies for the modules and generates a report
func Descriptor ¶
func Descriptor( info modfiles.ModFiles, ver *version.Version, addUnknownModules bool, modules map[string]bool, results *Results, onlydescr bool, walksubs bool, ) 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, ) error
Walks a module tree to list its constituent files
func PathRequires ¶
func PathRequires( sources []string, includeMods []string, ignoreMods []string, output string, outputFormat string, ) (descriptor.Requires, write.Files, string, error)
Retrieves the path dependencies for the modules and generates a report
Types ¶
type Results ¶
func Discover ¶
func Discover( sources []string, includeMods []string, ignoreMods []string, onlyRoot bool, output string, outputFormat string, ) (*Results, write.Files, string, error)
Discovers Go modules within the provided sources and generates a report
func Provides ¶
func Provides( sources []string, ver *version.Version, includeMods, ignoreMods []string, onlyName, onlyVersion bool, output, outputFormat string, ) (*Results, write.Files, string, error)
Generates a report of the provides information for the modules
func Scan ¶
func Scan( sources []string, ver *version.Version, includeMods []string, ignoreMods []string, onlydescr bool, ) (*Results, error)
Walks sources to find and read Go module source trees within
func (*Results) BuildRequires ¶
func (modules *Results) BuildRequires() (descriptor.Requires, error)
Retrieves the build dependencies for the modules
func (*Results) CSV ¶
Lists the modules in CSV format
func (*Results) Format ¶
Formats the module list in the specified format
func (*Results) JSON ¶
Lists the modules in JSON format
func (*Results) List ¶
Lists the modules in the provided format
func (*Results) Provides ¶
func (modules *Results) Provides() (descriptor.Provides, error)
Retrieves the provides information for the modules
func (*Results) Requires ¶
func (modules *Results) Requires() (descriptor.Requires, error)
Retrieves the runtime dependencies for the modules