Documentation ¶
Index ¶
- type RootModulesFeature
- func (f *RootModulesFeature) CallersOfModule(modPath string) ([]string, error)
- func (f *RootModulesFeature) InstalledModuleCalls(modPath string) (map[string]tfmod.InstalledModuleCall, error)
- func (f *RootModulesFeature) InstalledModulePath(rootPath string, normalizedSource string) (string, bool)
- func (f *RootModulesFeature) InstalledProviders(modPath string) (map[tfaddr.Provider]*version.Version, error)
- func (f *RootModulesFeature) SetLogger(logger *log.Logger)
- func (f *RootModulesFeature) Start(ctx context.Context)
- func (f *RootModulesFeature) Stop()
- func (f *RootModulesFeature) Telemetry(path string) map[string]interface{}
- func (f *RootModulesFeature) TerraformVersion(modPath string) *version.Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RootModulesFeature ¶
RootModulesFeature groups everything related to root modules. Its internal state keeps track of all root modules in the workspace. A root module is usually the directory where you would run `terraform init` and where the `.terraform` directory and `.terraform.lock.hcl` are located.
The feature listens to events from the EventBus to update its state and act on lockfile changes. It also provides methods to query root modules for the installed providers, modules, and Terraform version.
func NewRootModulesFeature ¶
func NewRootModulesFeature(eventbus *eventbus.EventBus, stateStore *globalState.StateStore, fs jobs.ReadOnlyFS, tfExecFactory exec.ExecutorFactory) (*RootModulesFeature, error)
func (*RootModulesFeature) CallersOfModule ¶
func (f *RootModulesFeature) CallersOfModule(modPath string) ([]string, error)
func (*RootModulesFeature) InstalledModuleCalls ¶
func (f *RootModulesFeature) InstalledModuleCalls(modPath string) (map[string]tfmod.InstalledModuleCall, error)
InstalledModuleCalls returns the installed module based on the module manifest
func (*RootModulesFeature) InstalledModulePath ¶
func (f *RootModulesFeature) InstalledModulePath(rootPath string, normalizedSource string) (string, bool)
InstalledModulePath checks the installed modules in the given root module for the given normalized source address.
If the module is installed, it returns the path to the module installation directory on disk.
func (*RootModulesFeature) InstalledProviders ¶
func (f *RootModulesFeature) InstalledProviders(modPath string) (map[tfaddr.Provider]*version.Version, error)
InstalledProviders returns the installed providers for the given module path
func (*RootModulesFeature) SetLogger ¶
func (f *RootModulesFeature) SetLogger(logger *log.Logger)
func (*RootModulesFeature) Start ¶
func (f *RootModulesFeature) Start(ctx context.Context)
Start starts the features separate goroutine. It listens to various events from the EventBus and performs corresponding actions.
func (*RootModulesFeature) Stop ¶
func (f *RootModulesFeature) Stop()
func (*RootModulesFeature) Telemetry ¶
func (f *RootModulesFeature) Telemetry(path string) map[string]interface{}
func (*RootModulesFeature) TerraformVersion ¶
func (f *RootModulesFeature) TerraformVersion(modPath string) *version.Version
TerraformVersion tries to find a modules Terraform version on a best effort basis. If a root module exists at the given path, it will return the Terraform version of that root module. If not, it will return the version of any of the other root modules.