opentofu/internal/addrs
Martin Atkins dc5964f8a3 refactoring: Use addrs.Map for maps with addresses as keys
We introduced the addrs.UniqueKey and addrs.UniqueKeyer mechanics as part
of implementing the ValidateMoves and ApplyMoves functions, as a way to
better encapsulate the solution to the problem that lots of our address
types aren't comparable and so cannot be used directly as map keys.

However, exposing addrs.UniqueKey handling directly in the logic adds
various noise to the algorithms and, in particular, obscures the fact that
MoveResults.Changes and MoveResult.Blocked both have different map key
types.

Here then we'll use the new addrs.Map helper type, which encapsulates the
idea of a map from an addrs.UniqueKeyer type to an arbitrary value type,
using the unique keys as the map keys internally. This does unfortunately
mean that we lose the conventional Go map access syntax and have to use
a method-based API instead, but I (subjectively) think that's an okay
compromise in return for avoiding the need to keep track inline of which
addrs.UniqueKey values correspond with which real addresses.

This is intended as an entirely-mechanical change, with equivalent
behavior to what it replaced. If anything here is doing something
materially different than what it replaced then that's a mistake.
2022-06-16 07:03:36 -07:00
..
check.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
checktype_string.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
count_attr.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
doc.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
for_each_attr.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
input_variable.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
instance_key.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
local_value.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
map_test.go addrs: Generic types for maps and sets of addresses 2022-06-16 07:03:36 -07:00
map.go addrs: Generic types for maps and sets of addresses 2022-06-16 07:03:36 -07:00
module_call.go Equal methods for move AbsMoveable 2021-08-10 10:12:17 -04:00
module_instance_test.go IsModuleMoveReIndex 2021-12-21 16:49:25 -05:00
module_instance.go addrs: ModuleInstance.ChildCall method 2021-07-28 13:54:10 -07:00
module_package.go addrs: ModuleRegistryPackage for representing module registry packages 2021-06-03 08:50:34 -07:00
module_source_test.go addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
module_source.go addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
module_test.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
module.go addrs: AbsMoveable, ConfigMoveable, and MoveableEndpoint 2021-07-01 08:28:02 -07:00
move_endpoint_kind.go addrs: MoveEndpointInModule 2021-07-14 17:37:48 -07:00
move_endpoint_module_test.go check for nested module index changes 2021-12-22 16:15:04 -05:00
move_endpoint_module.go check for nested module index changes 2021-12-22 16:15:04 -05:00
move_endpoint_test.go remove occurrences of AbsMovable 2021-11-15 11:05:33 +00:00
move_endpoint.go remove occurrences of AbsMovable 2021-11-15 11:05:33 +00:00
moveable.go add AffectedAbsResource to interface 2021-11-16 18:19:11 +00:00
moveendpointkind_string.go addrs: MoveEndpointInModule 2021-07-14 17:37:48 -07:00
output_value_test.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
output_value.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
parse_ref_test.go addrs: Rename AbsModuleCallOutput to ModuleCallInstanceOutput 2021-07-01 08:28:02 -07:00
parse_ref.go addrs: Reference.DisplayString method 2022-03-04 15:51:36 -05:00
parse_target_test.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
parse_target.go addrs: AbsMoveable, ConfigMoveable, and MoveableEndpoint 2021-07-01 08:28:02 -07:00
path_attr.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
provider_config_test.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
provider_config.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
provider_test.go addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
provider.go addrs: Rename DefaultRegistryHost to DefaultProviderRegistryHost 2021-06-03 08:50:34 -07:00
referenceable.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
resource_phase.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
resource_test.go addrs: AbsResource.UniqueKey distinct from AbsResourceInstance.UniqueKey 2021-09-22 09:01:10 -07:00
resource.go core: Store condition block results in plan 2022-04-04 15:36:29 -04:00
resourcemode_string.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
self.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
set.go refactoring: Use addrs.Map for maps with addresses as keys 2022-06-16 07:03:36 -07:00
target_test.go Move addrs/ to internal/addrs/ 2021-05-17 14:09:07 -07:00
targetable.go configs: add decodeMovedBlock behind a locked gate. (#28973) 2021-06-21 10:53:16 -04:00
terraform_attr.go addrs: UniqueKey and UniqueKeyer 2021-07-14 17:37:48 -07:00
unique_key_test.go addrs: ModuleInstance and AbsResourceInstance are UniqueKeyers 2021-07-14 17:37:48 -07:00
unique_key.go addrs: Generic types for maps and sets of addresses 2022-06-16 07:03:36 -07:00