File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed
Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 11package states
22
3- // TODO: We will refactor this file with StateStorage later
3+ import "github.com/zclconf/go-cty/cty"
4+
5+ // Backend represent a medium that Kusion will operate on.
6+ type Backend interface {
7+ // ConfigSchema returns a set of attributes that is needed to config this backend
8+ ConfigSchema () cty.Type
9+
10+ // Configure will config this backend with provided configuration
11+ Configure (obj cty.Value ) error
12+
13+ // StateStorage return a StateStorage to manage State
14+ StateStorage () StateStorage
15+ }
416
517var Backends = make (map [string ]func () StateStorage )
618
Original file line number Diff line number Diff line change @@ -5,21 +5,11 @@ import (
55
66 "kusionstack.io/kusion/pkg/engine/models"
77
8- "github.com/zclconf/go-cty/cty"
9-
108 "kusionstack.io/kusion/pkg/version"
119)
1210
13- // StateStorage represents the set of methods required for a State backend
11+ // StateStorage represents the set of methods to manipulate State in a specified storage
1412type StateStorage interface {
15- // ConfigSchema returns a description of the expected configuration
16- // structure for the receiving backend.
17- ConfigSchema () cty.Type
18-
19- // Configure uses the provided configuration to set configuration fields
20- // within the backend.
21- Configure (obj cty.Value ) error
22-
2313 // GetLatestState return nil if state not exists
2414 GetLatestState (query * StateQuery ) (* State , error )
2515
You can’t perform that action at this time.
0 commit comments