Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAquaTemplateToInstallSpec ¶
ConvertAquaTemplateToInstallSpec evaluates the Aqua asset template as a Go template, replacing variables with InstallSpec placeholders (e.g., .OS → ${OS}, .Version → ${TAG}, .SemVer → ${VERSION}). Accepts an optional extraVars map for additional template variables (e.g., AssetWithoutExt).
Types ¶
type AquaRegistryAdapter ¶
type AquaRegistryAdapter struct {
// contains filtered or unexported fields
}
AquaRegistryAdapter implements SourceAdapter for Aqua registry YAML files.
func NewAquaRegistryAdapterFromReader ¶
func NewAquaRegistryAdapterFromReader(reader io.Reader) *AquaRegistryAdapter
NewAquaRegistryAdapterFromReader creates an adapter from an io.Reader (stdin, file, etc.).
func NewAquaRegistryAdapterFromRepo ¶
func NewAquaRegistryAdapterFromRepo(repo string, ref string) *AquaRegistryAdapter
NewAquaRegistryAdapterFromRepo creates an adapter that fetches the registry YAML from GitHub. If ref is empty, "HEAD" is used.
func (*AquaRegistryAdapter) GenerateInstallSpec ¶
func (a *AquaRegistryAdapter) GenerateInstallSpec(ctx context.Context) (*spec.InstallSpec, error)
GenerateInstallSpec parses the Aqua registry config and returns the first valid InstallSpec for a supported package. Currently, only packages of type "github_release" are supported. If version overrides are present, the first valid override is returned. Returns an error if no valid package is found or if template conversion fails.
type GitHubAdapter ¶
type GitHubAdapter struct {
// contains filtered or unexported fields
}
GitHubAdapter implements SourceAdapter for GitHub release using `aqua generatea-registry` internally. Note: No aqua CLI dependency.
func NewGitHubAdapter ¶
func NewGitHubAdapter(repo string) *GitHubAdapter
NewGitHubAdapter creates an adapter that generate aqua registry YAML from GitHub release and then convert it to binstalelr's InstallSpec.
func (*GitHubAdapter) GenerateInstallSpec ¶
func (g *GitHubAdapter) GenerateInstallSpec(ctx context.Context) (*spec.InstallSpec, error)
type SourceAdapter ¶
type SourceAdapter interface {
// GenerateInstallSpec generates an InstallSpec using the context provided at construction.
GenerateInstallSpec(ctx context.Context) (*spec.InstallSpec, error)
}
SourceAdapter defines the interface for generating an InstallSpec from various sources like GoReleaser config, GitHub releases, or CLI flags.
func NewGoReleaserAdapter ¶
func NewGoReleaserAdapter(repo, filePath, commit, nameOverride string) SourceAdapter
NewGoReleaserAdapter creates a new adapter for GoReleaser sources.