github.com/gavinw2006/hashicorp-terraform@v0.11.12-beta1/configs/configload/loader_install_hooks.go (about) 1 package configload 2 3 import version "github.com/hashicorp/go-version" 4 5 // InstallHooks is an interface used to provide notifications about the 6 // installation process being orchestrated by InstallModules. 7 // 8 // This interface may have new methods added in future, so implementers should 9 // embed InstallHooksImpl to get no-op implementations of any unimplemented 10 // methods. 11 type InstallHooks interface { 12 // Download is called for modules that are retrieved from a remote source 13 // before that download begins, to allow a caller to give feedback 14 // on progress through a possibly-long sequence of downloads. 15 Download(moduleAddr, packageAddr string, version *version.Version) 16 17 // Install is called for each module that is installed, even if it did 18 // not need to be downloaded from a remote source. 19 Install(moduleAddr string, version *version.Version, localPath string) 20 } 21 22 // InstallHooksImpl is a do-nothing implementation of InstallHooks that 23 // can be embedded in another implementation struct to allow only partial 24 // implementation of the interface. 25 type InstallHooksImpl struct { 26 } 27 28 func (h InstallHooksImpl) Download(moduleAddr, packageAddr string, version *version.Version) { 29 } 30 31 func (h InstallHooksImpl) Install(moduleAddr string, version *version.Version, localPath string) { 32 } 33 34 var _ InstallHooks = InstallHooksImpl{}