Documentation
¶
Index ¶
- func BinDir() string
- func EnsureCommand(ctx context.Context, command, version string) (string, error)
- func PackageDir(owner, repo, version string) string
- func PrependBinDirToEnv(env []string) []string
- func RegistryDir() string
- func ToolsDir() string
- type Override
- type Package
- type PackageFile
- type Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinDir ¶
func BinDir() string
BinDir returns the directory where tool binaries/symlinks are placed. This is ToolsDir()/bin/
func EnsureCommand ¶
EnsureCommand makes sure a command binary is available. It checks PATH first, then the docker agent tools directory, then attempts to install from the aqua registry if auto-install is enabled.
Returns the resolved command (may be the same string if found in PATH, or a full path to the installed binary) and any error encountered. When auto-install is disabled (globally or per-toolset), the original command is returned with no error.
func PackageDir ¶
PackageDir returns the directory for a specific package version. This is ToolsDir()/packages/<owner>/<repo>/<version>/
func PrependBinDirToEnv ¶
PrependBinDirToEnv takes an env slice and ensures the tools bin directory is prepended to the PATH entry. This allows installed tools to find other installed tools (e.g., npx finding node).
func RegistryDir ¶
func RegistryDir() string
RegistryDir returns the directory for cached registry data.
Types ¶
type Override ¶
type Override struct {
GOOS string `yaml:"goos"`
GOArch string `yaml:"goarch"`
Asset string `yaml:"asset"`
Format string `yaml:"format"`
Files []PackageFile `yaml:"files"`
Replacements map[string]string `yaml:"replacements"`
}
Override represents a platform-specific override for a package.
type Package ¶
type Package struct {
Type string `yaml:"type"`
RepoOwner string `yaml:"repo_owner"`
RepoName string `yaml:"repo_name"`
Description string `yaml:"description"`
Asset string `yaml:"asset"`
Format string `yaml:"format"`
Files []PackageFile `yaml:"files"`
Overrides []Override `yaml:"overrides"`
Replacements map[string]string `yaml:"replacements"`
SupportedEnvs []string `yaml:"supported_envs"`
VersionFilter string `yaml:"version_filter"`
VersionPrefix string `yaml:"version_prefix"`
Name string `yaml:"name"`
// GoInstallPath is the Go module path for go_install/go_build packages.
// Example: "golang.org/x/tools/gopls"
GoInstallPath string `yaml:"path"`
}
Package represents a parsed aqua registry package definition.
func (*Package) BinaryName ¶
BinaryName returns the primary binary name this package provides.
func (*Package) IsGoPackage ¶
IsGoPackage returns true if this package is installed via "go install".
type PackageFile ¶
PackageFile describes a file within a downloaded archive.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry provides lookup of aqua packages.
func NewRegistry ¶
func NewRegistry() *Registry
NewRegistry creates a new Registry with default settings.
func SharedRegistry ¶
func SharedRegistry() *Registry
SharedRegistry returns a package-level Registry instance that is reused across all tool resolutions within a docker agent session, avoiding repeated YAML parsing and HTTP fetches.
func (*Registry) Install ¶
Install downloads and installs a package at the specified version. Returns the path to the installed binary.
func (*Registry) LookupByCommand ¶
LookupByCommand searches for a package providing a binary matching the command name. First checks repo names, then files[].name across all packages.
func (*Registry) LookupByName ¶
LookupByName searches the registry for a package by "owner/repo" identifier. Searches the full registry index first, then falls back to fetching the per-package YAML from pkgs/<owner>/<repo>/registry.yaml.