Documentation ¶
Index ¶
- func IsModuleFilename(name string) bool
- func ParseModuleManifest(modPath string) (*datadir.ModuleManifest, error)
- type InstalledModules
- type ModuleState
- type RootState
- func (s *RootState) AddModuleState(fs filesystem.FS, modPath string, tfstate *tfjson.StateModule) error
- func (s *RootState) DeclaredModuleCalls(modPath string) (map[string]tfmodule.DeclaredModuleCall, error)
- func (s *RootState) Decoder() *decoder.Decoder
- func (s *RootState) InstalledModulePath(rootPath string, normalizedSource string) (string, bool)
- func (s *RootState) LocalModuleMeta(modPath string) (*tfmodule.Meta, error)
- func (s *RootState) PathContext(path lang.Path) (*decoder.PathContext, error)
- func (s *RootState) Paths(ctx context.Context) []lang.Path
- func (s *RootState) ProviderSchema(modPath string, addr tfaddr.Provider, vc version.Constraints) (*tfschema.ProviderSchema, error)
- func (s *RootState) RegistryModuleMeta(addr tfaddr.Module, cons version.Constraints) (*registry.ModuleData, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsModuleFilename ¶
func ParseModuleManifest ¶
func ParseModuleManifest(modPath string) (*datadir.ModuleManifest, error)
Types ¶
type InstalledModules ¶
InstalledModules is a map of normalized source addresses from the manifest to the path of the local directory where the module is installed
func InstalledModulesFromManifest ¶
func InstalledModulesFromManifest(manifest *datadir.ModuleManifest) InstalledModules
type ModuleState ¶
type ModuleState struct { SourceAddr tfmodule.ModuleSourceAddr Meta tfmodule.Meta Files map[string]*hcl.File // The terraform state of the resources/data sources. // Only the resource with no resource/module "count"/"for_each" used will be populated. // // The key is the relative resource address to the containing module, without the index part: // - Absoulute address: [module.<module name>[\[index\]].][data.]<resource type>.<resource name>[\[<index>\]] // - Relative address : [data.]<resource type>.<resource name> // (as we only support non-index addressed resources) TFStateResources map[string]*tfjson.StateResource OriginRefs reference.Origins TargetRefs reference.Targets }
type RootState ¶
type RootState struct { // RootPath is the root module's path RootPath string CoreVersion *version.Version CoreSchema *schema.BodySchema ProviderSchemas map[tfaddr.Provider]*tfschema.ProviderSchema ProviderSchemasJSON *tfjson.ProviderSchemas ModuleManifest *datadir.ModuleManifest // InstalledModules is a map of normalized source addresses from the // manifest to the path of the local directory where the module is installed InstalledModules InstalledModules // ModuleStates includes states of each module, keyed by module path. // Especially, the "." key represents the root module. // // TODO: Shall we use tfmodule.ModuleSourceAddr instead? ModuleStates map[string]*ModuleState }
func NewRootState ¶
func (*RootState) AddModuleState ¶
func (s *RootState) AddModuleState(fs filesystem.FS, modPath string, tfstate *tfjson.StateModule) error
func (*RootState) DeclaredModuleCalls ¶
func (s *RootState) DeclaredModuleCalls(modPath string) (map[string]tfmodule.DeclaredModuleCall, error)
DeclaredModuleCalls implements schema.StateReader.
func (*RootState) InstalledModulePath ¶
InstalledModulePath implements schema.StateReader.
func (*RootState) LocalModuleMeta ¶
LocalModuleMeta implements schema.StateReader.
func (*RootState) PathContext ¶
PathContext implements decoder.PathReader. Per: https://github.com/hashicorp/terraform-ls/blob/abe92f01988de5445556fe1576765cb8f1cb80d9/internal/features/modules/decoder/path_reader.go#L67
func (*RootState) ProviderSchema ¶
func (s *RootState) ProviderSchema(modPath string, addr tfaddr.Provider, vc version.Constraints) (*tfschema.ProviderSchema, error)
ProviderSchema implements schema.StateReader.
func (*RootState) RegistryModuleMeta ¶
func (s *RootState) RegistryModuleMeta(addr tfaddr.Module, cons version.Constraints) (*registry.ModuleData, error)
RegistryModuleMeta implements schema.StateReader.
Click to show internal directories.
Click to hide internal directories.