hashicorp

package
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 15 Imported by: 0

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

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

func New(opts ...Option) *Provider

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

func (p *Provider) Color(dark bool) color.Color

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

func (p *Provider) Describe(r provider.Resource) string

Describe returns a human-readable label for a resource, noting the build flavor or enterprise edition when one is selected.

func (*Provider) Discover

func (p *Provider) Discover(ctx context.Context, r provider.Resource) ([]model.Candidate, error)

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

func (p *Provider) Identify(r provider.Resource) (string, string)

Identify returns the product name and its releases page.

func (*Provider) Keys

func (p *Provider) Keys() []provider.Key

Keys reports the directive keys hashicorp accepts, in canonical order.

func (*Provider) Name

func (p *Provider) Name() string

Name identifies the provider.

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.

func (*Provider) Resource

func (p *Provider) Resource(d directive.Directive) (provider.Resource, error)

Resource validates a directive into a HashiCorp resource.

func (*Provider) URL

URL builds the web page for a resolved candidate: the product's release page for the candidate's version. Empty when the version is unknown.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL