package modgraph

Import Path
	go.pact.im/x/goship/internal/modgraph (on go.dev)

Dependency Relation
	imports 6 packages, and imported by 3 packages

Involved Source Files Package modgraph represents Go modules, filters eligible modules, and builds layered topological dependency graphs. filter.go graph.go
Package-Level Type Names (total 5, all are exported)
/* sort exporteds by: | */
FilterOptions configures module filtering. Exclude []string ExcludeVersions []string Include []string Targets []string func Filter(modules []*Module, opts FilterOptions) (kept []*Module, skipped []SkippedModule, err error) func go.pact.im/x/goship/internal/release.InspectSnapshot(snap *release.Snapshot, filter FilterOptions) (*release.Inspection, error)
Graph represents a directed acyclic dependency graph of Go modules. DependentsOf returns the sorted intra-graph modules that depend on modPath. DepsOf returns the sorted intra-graph dependencies of modPath. Layers returns the modules partitioned into topological layers. Module looks up a module by its Go module path. Modules returns all modules in topological order. Subgraph returns a new layered Graph containing only modules whose Path is present in selected. TransitiveDependents returns the set of all module paths in g that are either in seeds or depend (directly or transitively) on a module in seeds. func Build(modules []*Module) (*Graph, error) func (*Graph).Subgraph(selected map[string]bool) (*Graph, error)
Module represents a Go module participating in the dependency graph. Dir is the repo-relative slash path (e.g. "." or "clock"). Path is the Go module path (from go.mod’s module directive). Requires lists all require directives in the module’s go.mod. func Filter(modules []*Module, opts FilterOptions) (kept []*Module, skipped []SkippedModule, err error) func (*Graph).DependentsOf(modPath string) []*Module func (*Graph).DepsOf(modPath string) []*Module func (*Graph).Layers() [][]*Module func (*Graph).Module(path string) (*Module, bool) func (*Graph).Modules() []*Module func go.pact.im/x/goship/internal/workspace.(*AutoLoader).Load(ctx context.Context, v vcs.VCS, rev string) ([]*Module, error) func go.pact.im/x/goship/internal/workspace.Loader.Load(ctx context.Context, v vcs.VCS, rev string) ([]*Module, error) func go.pact.im/x/goship/internal/workspace.(*WalkLoader).Load(ctx context.Context, v vcs.VCS, rev string) ([]*Module, error) func go.pact.im/x/goship/internal/workspace.(*WorkLoader).Load(ctx context.Context, v vcs.VCS, rev string) ([]*Module, error) func Build(modules []*Module) (*Graph, error) func Filter(modules []*Module, opts FilterOptions) (kept []*Module, skipped []SkippedModule, err error)
Require represents a single module requirement from go.mod. Indirect bool Path string Version string
SkippedModule pairs a filtered-out module with the reason it was skipped. Module *Module Reason string func Filter(modules []*Module, opts FilterOptions) (kept []*Module, skipped []SkippedModule, err error)
Package-Level Functions (total 11, in which 2 are exported)
Build constructs a Graph from modules, detects dependency cycles, and partitions the modules into topological layers using Kahn’s algorithm. Layer 0 contains modules with no intra-graph dependencies. Each subsequent layer k contains modules whose intra-graph dependencies all appear in layers strictly less than k.
Filter partitions modules into kept and skipped according to opts.
Package-Level Variables (only one, which is exported)
ErrNoModules is returned when loading or filtering yields zero modules.