Documentation ¶
Index ¶
- Variables
- func ModulesPathExist() (bool, error)
- func NewResolver(cln *client.Client) (codegen.Resolver, error)
- func NewTree(ctx context.Context, cln *client.Client, mod *ast.Module, long bool) (treeprint.Tree, error)
- func ResolveGraph(ctx context.Context, cln *client.Client, resolver codegen.Resolver, ...) error
- func Vendor(ctx context.Context, cln *client.Client, mod *ast.Module, targets []string, ...) error
- func VendorPath(root string, dgst digest.Digest) string
- type VisitInfo
- type Visitor
Constants ¶
This section is empty.
Variables ¶
var ( // DotHLBPath is a relative directory containing files related to HLB. // It is expected to commit files in this directory to git repositories. DotHLBPath = "./.hlb" // ModulesPath is the subdirectory of DotHLBPath that contains vendored // modules. ModulesPath = filepath.Join(DotHLBPath, "modules") )
Functions ¶
func ModulesPathExist ¶
ModulesPathExist returns true if the modules directory exists in the current working directory.
func NewResolver ¶
NewResolver returns a resolver based on whether the modules path exists in the current working directory.
func NewTree ¶
func NewTree(ctx context.Context, cln *client.Client, mod *ast.Module, long bool) (treeprint.Tree, error)
NewTree resolves the import graph and returns a treeprint.Tree that can be printed to display a visualization of the imports. Imports that transitively import the same module will be duplicated in the tree.
func ResolveGraph ¶
func ResolveGraph(ctx context.Context, cln *client.Client, resolver codegen.Resolver, mod *ast.Module, visitor Visitor) error
ResolveGraph traverses the import graph of a given module.
func Vendor ¶
func Vendor(ctx context.Context, cln *client.Client, mod *ast.Module, targets []string, tidy bool) error
Vendor resolves the import graph and writes the contents into the modules directory of the current working directory.
If tidy mode is enabled, vertices with digests that already exist in the modules directory are skipped, and unused modules are pruned.