Documentation ¶
Overview ¶
Copyright 2022 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package registry provides tools for interacting with a Terraform custom registry
Copyright 2022 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsProviderTarball ¶
IsProviderTarball tests if a given string is a Houston-compatible filename indicating a terraform-provider plugin type
func VersionsFilePath ¶
Types ¶
type Download ¶
type Download struct { Protocols []string `json:"protocols"` OS string `json:"os"` Arch string `json:"arch"` Filename string `json:"filename"` DownloadURL string `json:"download_url"` ShaURL string `json:"shasums_url"` SignatureURL string `json:"shasums_signature_url"` Sha string `json:"shasum"` SigningKeys SigningKeys `json:"signing_keys"` }
Download describes the file specific download package for a given platform & provider version. If a provider supports multiple OSs & architectures, the registry will contain multiple Download records, one for each unique architecture/OS pair.
func NewDownloadFromRepackResult ¶
func NewDownloadFromRepackResult(info *RepackResult, protocols []string, objectStoreURL string) (*Download, error)
NewDownloadFromRepackResult creates a new, fully-populated Download object from the result of repacking a Houston-compatible tarball into a Terraform registry-compatible zip archive
type FileNames ¶
FileNames describes the location of a registry-compatible zipfile and its associated sidecar files
type GpgPublicKey ¶
type GpgPublicKey struct { KeyID string `json:"key_id"` ASCIIArmor string `json:"ascii_armor"` TrustSignature string `json:"trust_signature"` Source string `json:"source,omitempty"` SourceURL string `json:"source_url,omitempty"` }
GpgPublicKey describes a (the public half) of a GPG key used to sign a provider zipfile.
type RepackResult ¶
RepackResult describes a fully-repacked provider and all of its sidecar files
func RepackProvider ¶
func RepackProvider(dstDir string, srcFileName string, signingEntity *openpgp.Entity) (*RepackResult, error)
RepackProvider takes a provider tarball and repacks it as a zipfile compatible with a terraform provider registry, generating all the required sidecar files as well. Returns a `RepackResult` instance containing the location of the generated files and information about the packed plugin
For more information on the output files, see the Terraform Provider Registry Protocol documentation:
https://www.terraform.io/internals/provider-registry-protocol
func (*RepackResult) Sha256String ¶
func (r *RepackResult) Sha256String() string
Sha256String formats the binary SHA256 as a hex string
type SigningKeys ¶
type SigningKeys struct {
GpgPublicKeys []GpgPublicKey `json:"gpg_public_keys"`
}
SigningKeys describes the key (or keys) that signed a given download. As per the registry protocol, only GPG keys are supported for now.
type Version ¶
type Version struct { Version semver.Version `json:"version"` Protocols []string `json:"protocols"` Platforms []Platform `json:"platforms"` }
Version describes tha compatability and available platforms for a given provider version
type Versions ¶
type Versions struct {
Versions []Version `json:"versions"`
}
Versions is a Go representation of the Terraform Registry Protocol `versions` file
func LoadVersionsFile ¶
LoadVersionsFile reads and parses a versions structure from the file at the supplied filesystem location