package
1.12.0-alpha20250213
Repository: https://github.com/hashicorp/terraform.git
Documentation: pkg.go.dev
# Packages
Package providerreqs contains types we use to talk about provider requirements.
# Functions
ErrIsNotExist returns true if and only if the given error is one of the errors from this package that represents an affirmative response that a requested object does not exist.
FakeInstallablePackageMeta constructs and returns a PackageMeta that points to a temporary archive file that could actually be installed in principle.
FakePackageMeta constructs and returns a PackageMeta that carries the given metadata but has fake location information that is likely to fail if attempting to install from it.
HashLegacyZipSHAFromSHA is a convenience method to produce the schemed-string hash format from an already-calculated hash of a provider .zip archive.
HostFromRequest extracts host the same way net/http Request.Write would, accounting for empty Request.Host.
MeetingConstraints returns a version set that contains all of the versions that meet the given constraints, specified using the Spec type from the constraints package.
MissingProviderSuggestion takes a provider address that failed installation due to the remote registry reporting that it didn't exist, and attempts to find another provider that the user might have meant to select.
MustParseHash is a wrapper around ParseHash that panics if it returns an error.
MustParseVersion is a variant of ParseVersion that panics if it encounters an error while parsing.
MustParseVersionConstraints is a variant of ParseVersionConstraints that panics if it encounters an error while parsing.
NewArchiveChecksumAuthentication returns a PackageAuthentication implementation that checks that the original distribution archive matches the given hash.
NewFilesystemMirrorSource constructs and returns a new filesystem-based mirror source with the given base directory.
NewHTTPMirrorSource constructs and returns a new network mirror source with the given base URL.
NewMatchingChecksumAuthentication returns a PackageAuthentication implementation that scans a registry-provided SHA256SUMS document for a specified filename, and compares the SHA256 hash against the expected hash.
NewMemoizeSource constructs and returns a new MemoizeSource that wraps the given underlying source and memoizes its results.
NewMockSource creates and returns a MockSource with the given packages.
NewPackageHashAuthentication returns a PackageAuthentication implementation that checks whether the contents of the package match whatever subset of the given hashes are considered acceptable by the current version of Terraform.
NewRegistrySource creates and returns a new source that will install providers from their originating provider registries.
NewSignatureAuthentication returns a PackageAuthentication implementation that verifies the cryptographic signature for a package against any of the provided keys.
PackageAuthenticationAll combines several authentications together into a single check value, which passes only if all of the given ones pass.
PackageHash computes a hash of the contents of the package at the given location, using whichever hash algorithm is the current default.
PackageHashLegacyZipSHA implements the old provider package hashing scheme of taking a SHA256 hash of the containing .zip archive itself, rather than of the contents of the archive.
PackageHashV1 computes a hash of the contents of the package at the given location using hash algorithm 1.
PackageMatchesAnyHash returns true if the package at the given location matches at least one of the given hashes, or false otherwise.
PackageMatchesHash returns true if the package at the given location matches the given hash, or false otherwise.
PackedFilePathForPackage is similar to PackageMeta.PackedFilePath but makes its decision based on individually-passed provider address, version, and target platform so that it can be used by callers outside this package that may have other types that represent package identifiers.
ParseHash parses the string representation of a Hash into a Hash value.
ParseMultiSourceMatchingPatterns parses a slice of strings containing the string form of provider matching patterns and, if all the given strings are valid, returns the corresponding, normalized, MultiSourceMatchingPatterns value.
ParsePlatform parses a string representation of a platform, like "linux_amd64", or returns an error if the string is not valid.
ParseVersion parses a "semver"-style version string into a Version value, which is the version syntax we use for provider versions.
ParseVersionConstraints parses a "Ruby-like" version constraint string into a VersionConstraints value.
PreferredHashes examines all of the given hash strings and returns the one that the current version of Terraform considers to provide the strongest verification.
SearchLocalDirectory performs an immediate, one-off scan of the given base directory for provider plugins using the directory structure defined for FilesystemMirrorSource.
UnpackedDirectoryPathForPackage is similar to PackageMeta.UnpackedDirectoryPath but makes its decision based on individually-passed provider address, version, and target platform so that it can be used by callers outside this package that may have other types that represent package identifiers.
VersionConstraintsString returns a canonical string representation of a VersionConstraints value.
# Constants
HashicorpPartnersKey is a key created by HashiCorp, used to generate and verify trust signatures for Partner tier providers.
HashicorpPublicKey is the HashiCorp public key, also available at https://www.hashicorp.com/security.
HashScheme1 is the scheme identifier for the first hash scheme.
HashSchemeZip is the scheme identifier for the legacy hash scheme that applies to distribution archives (.zip files) rather than package contents, and can therefore only be verified against the original distribution .zip file, not an extracted directory.
NilHash is the zero value of Hash.
Wildcard is a string value representing a wildcard element in the Include and Exclude patterns used with MultiSource.
# Variables
CurrentPlatform is the platform where the current program is running.
No description provided by the author
UnspecifiedVersion is the zero value of Version, representing the absense of a version number.
# Structs
ErrHostNoProviders is an error type used to indicate that a hostname given in a provider address does not support the provider registry protocol.
ErrHostUnreachable is an error type used to indicate that a hostname given in a provider address did not resolve in DNS, did not respond to an HTTPS request for service discovery, or otherwise failed to correctly speak the service discovery protocol.
ErrPlatformNotSupported is an error type used to indicate that a particular version of a provider isn't available for a particular target platform.
ErrProtocolNotSupported is an error type used to indicate that a particular version of a provider is not supported by the current version of Terraform.
ErrProviderNotFound is an error type used to indicate that requested provider was not found in the source(s) included in the Description field.
ErrQueryFailed is an error type used to indicate that the hostname given in a provider address does appear to be a provider registry but that when we queried it for metadata for the given provider the server returned an unexpected error.
ErrRegistryProviderNotKnown is an error type used to indicate that the hostname given in a provider address does appear to be a provider registry but that registry does not know about the given provider namespace or type.
ErrRequestCanceled is an error type used to indicate that an operation failed due to being cancelled via the given context.Context object.
ErrUnauthorized is an error type used to indicate that a hostname given in a provider address returned a "401 Unauthorized" or "403 Forbidden" error response when we tried to access it.
FilesystemMirrorSource is a source that reads providers and their metadata from a directory prefix in the local filesystem.
HangingSource is an implementation of Source which hangs until the given context is cancelled.
HTTPMirrorSource is a source that reads provider metadata from a provider mirror that is accessible over the HTTP provider mirror protocol.
MemoizeSource is a Source that wraps another Source and remembers its results so that they can be returned more quickly on future calls to the same object.
MockSource is an in-memory-only, statically-configured source intended for use only in unit tests of other subsystems that consume provider sources.
MultiSourceSelector is an element of the source selection configuration on MultiSource.
PackageAuthenticationResult is returned from a PackageAuthentication implementation.
PackageMeta represents the metadata related to a particular downloadable provider package targeting a single platform.
Platform represents a target platform that a provider is or might be available for.
RegistrySource is a Source that knows how to find and install providers from their originating provider registries.
SigningKey represents a key used to sign packages from a registry, along with an optional trust signature from the registry operator.
# Interfaces
PackageAuthentication is an interface implemented by the optional package authentication implementations a source may include on its PackageMeta objects.
PackageAuthenticationHashes is an optional interface implemented by PackageAuthentication implementations that are able to return a set of hashes they would consider valid if a given PackageLocation referred to a package that matched that hash string.
PackageLocation represents a location where a provider distribution package can be obtained.
A Source can query a particular source for information about providers that are available to install.
# Type aliases
Hash is a specially-formatted string representing a checksum of a package or the contents of the package.
HashScheme is an enumeration of schemes that are allowed for values of type Hash.
MultiSource is a Source that wraps a series of other sources and combines their sets of available providers and provider versions.
MultiSourceMatchingPatterns is a set of patterns that together define a set of providers by matching on the segments of the provider FQNs.
PackageHTTPURL is a provider package location accessible via HTTP.
PackageLocalArchive is the location of a provider distribution archive file in the local filesystem.
PackageLocalDir is the location of a directory containing an unpacked provider distribution archive in the local filesystem.
PackageMetaList is a list of PackageMeta.
Requirements gathers together requirements for many different providers into a single data structure, as a convenient way to represent the full set of requirements for a particular configuration or state or both.
Selections gathers together version selections for many different providers.
Version represents a particular single version of a provider.
VersionConstraints represents a set of version constraints, which can define the membership of a VersionSet by exclusion.
VersionList represents a list of versions.
VersionSet represents a set of versions, usually describing the acceptable versions that can be selected under a particular version constraint provided by the end-user.
Warnings represents a list of warnings returned by a Registry source.