From e4d14324e06f40e94f062e866f333e501c45e940 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 11 Mar 2020 18:10:25 -0700 Subject: [PATCH] internal/providercache: Stub of Dir.InstallPackage method This will eventually be responsible for actually retrieving a package from a source and then installing it into the cache directory, but for the moment it's just a stub to complete the proposed API, which I intend to test in a subsequent commit by writing the full "Installer" API that will encapsulate the full installation logic. --- internal/providercache/dir_modify.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/providercache/dir_modify.go b/internal/providercache/dir_modify.go index c43af2dad..d8f4c7282 100644 --- a/internal/providercache/dir_modify.go +++ b/internal/providercache/dir_modify.go @@ -9,6 +9,14 @@ import ( "github.com/hashicorp/terraform/internal/getproviders" ) +// InstallPackage takes a metadata object describing a package available for +// installation, retrieves that package, and installs it into the receiving +// cache directory. +func (d *Dir) InstallPackage(meta getproviders.PackageMeta) error { + // TODO: Implement this + return fmt.Errorf("InstallPackage is not yet implemented") +} + // LinkFromOtherCache takes a CachedProvider value produced from another Dir // and links it into the cache represented by the receiver Dir. //