-
Notifications
You must be signed in to change notification settings - Fork 10
/
moveable.go
57 lines (50 loc) · 1.91 KB
/
moveable.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package addrs
// AbsMoveable is an interface implemented by address types that can be either
// the source or destination of a "moved" statement in configuration, along
// with any other similar cross-module state refactoring statements we might
// allow.
//
// Note that AbsMoveable represents an absolute address relative to the root
// of the configuration, which is different than the direct representation
// of these in configuration where the author gives an address relative to
// the current module where the address is defined. The type MoveEndpoint
type AbsMoveable interface {
absMoveableSigil()
UniqueKeyer
String() string
}
// The following are all of the possible AbsMoveable address types:
var (
_ AbsMoveable = AbsResource{}
_ AbsMoveable = AbsResourceInstance{}
_ AbsMoveable = ModuleInstance(nil)
_ AbsMoveable = AbsModuleCall{}
)
// AbsMoveableResource is an AbsMoveable that is either a resource or a resource
// instance.
type AbsMoveableResource interface {
AbsMoveable
AffectedAbsResource() AbsResource
}
// The following are all of the possible AbsMoveableResource types:
var (
_ AbsMoveableResource = AbsResource{}
_ AbsMoveableResource = AbsResourceInstance{}
)
// ConfigMoveable is similar to AbsMoveable but represents a static object in
// the configuration, rather than an instance of that object created by
// module expansion.
//
// Note that ConfigMovable represents an absolute address relative to the root
// of the configuration, which is different than the direct representation
// of these in configuration where the author gives an address relative to
// the current module where the address is defined. The type MoveEndpoint
// represents the relative form given directly in configuration.
type ConfigMoveable interface {
configMoveableSigil()
}
// The following are all of the possible ConfigMovable address types:
var (
_ ConfigMoveable = ConfigResource{}
_ ConfigMoveable = Module(nil)
)