File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ import (
14
14
"github.com/hashicorp/terraform/internal/plans"
15
15
)
16
16
17
- var _ ConfigState [BackendConfigState ] = & BackendConfigState {}
17
+ var _ ConfigState = & BackendConfigState {}
18
+ var _ DeepCopier [BackendConfigState ] = & BackendConfigState {}
18
19
var _ Planner [plans.Backend ] = & BackendConfigState {}
19
20
20
21
// BackendConfigState describes the physical storage format for the backend state
Original file line number Diff line number Diff line change @@ -9,13 +9,20 @@ import (
9
9
)
10
10
11
11
// ConfigState describes a configuration block, and is used to make that config block stateful.
12
- type ConfigState [ T any ] interface {
12
+ type ConfigState interface {
13
13
Empty () bool
14
14
Config (* configschema.Block ) (cty.Value , error )
15
15
SetConfig (cty.Value , * configschema.Block ) error
16
+ }
17
+
18
+ // DeepCopier implementations can return deep copies of themselves for use elsewhere
19
+ // without mutating the original value.
20
+ type DeepCopier [T any ] interface {
16
21
DeepCopy () * T
17
22
}
18
23
24
+ // Planner implementations can return a representation of their data that's
25
+ // appropriate for storing in a plan file.
19
26
type Planner [T any ] interface {
20
27
Plan (* configschema.Block , string ) (* T , error )
21
28
}
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import (
15
15
ctyjson "github.com/zclconf/go-cty/cty/json"
16
16
)
17
17
18
- var _ ConfigState [StateStoreConfigState ] = & StateStoreConfigState {}
18
+ var _ ConfigState = & StateStoreConfigState {}
19
+ var _ DeepCopier [StateStoreConfigState ] = & StateStoreConfigState {}
19
20
var _ Planner [plans.StateStore ] = & StateStoreConfigState {}
20
21
21
22
// StateStoreConfigState describes the physical storage format for the state store
You can’t perform that action at this time.
0 commit comments