Documentation
¶
Overview ¶
Package hashicorp resolves HashiCorp tool versions (Terraform, Vault, Consul, Nomad, Packer, Boundary, Sentinel, ...) from HashiCorp's public, unauthenticated releases API. It lists a product's releases newest-first, tagging each with the prerelease flag and creation date the API supplies. By default it tracks the open-source releases; enterprise selects enterprise releases (bare semver), and build selects one enterprise build flavor by its +metadata suffix (e.g. ent.hsm.fips1403), rendering the full version. Checksums are left to a follower reading the product's predictable SHA256SUMS file.
Index ¶
- type Option
- type Provider
- func (p *Provider) Color(dark bool) color.Color
- func (p *Provider) Dated()
- func (p *Provider) Describe(r provider.Resource) string
- func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)
- func (p *Provider) Identify(r provider.Resource) (string, string)
- func (p *Provider) Keys() []provider.Key
- func (p *Provider) Name() string
- func (p *Provider) RecencyOrdered()
- func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)
- func (p *Provider) URL(r provider.Resource, c model.Candidate) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Provider)
Option configures a Provider.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport overrides the HTTP transport, for tests.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider resolves HashiCorp tool versions (Terraform, Vault, Consul, Nomad, ...) from HashiCorp's public, unauthenticated releases service. Discovery is a single JSON listing per product; the framework owns selection, so the provider only lists candidates and tags each with the metadata the API returns for free.
func New ¶
New returns the HashiCorp provider. The releases service is public and publishes no rate-limit headers, so the client is a plain cached one with no ratelimit wrapper or credentials.
func (*Provider) Color ¶ added in v0.3.10
Color is the provider's brand color. See provider.Provider.Color.
func (*Provider) Dated ¶ added in v0.2.8
func (p *Provider) Dated()
Dated marks the listing as date-bearing: every release carries a creation date, so cooldown applies.
func (*Provider) Describe ¶
Describe returns a human-readable label for a resource, noting the build flavor or enterprise edition when one is selected.
func (*Provider) Discover ¶
Discover lists candidate versions for a product, reading the releases API newest-first. A shallow lookup reads only the first page - the latest release is always on it, since the listing is newest-first; --deep walks the cursor to exhaustion for a constraint pinned to an older release.
func (*Provider) Identify ¶ added in v0.3.10
Identify returns the product name and its releases page.
func (*Provider) RecencyOrdered ¶
func (p *Provider) RecencyOrdered()
RecencyOrdered marks the releases listing as newest-first, so a shallow lookup always holds the latest release; --deep is hinted only when a constrained marker finds no candidate while more pages remained.