add document state transformer interface
Some checks are pending
Lint / golangci-lint (push) Waiting to run
Declarative Tests / test (push) Waiting to run
Declarative Tests / build-fedora (push) Waiting to run
Declarative Tests / build-ubuntu-focal (push) Waiting to run

This commit is contained in:
Matthew Rich 2024-09-25 04:43:18 +00:00
parent 614b4426c2
commit 452695c8f5
2 changed files with 11 additions and 2 deletions

View File

@ -32,7 +32,12 @@ type DocumentGetter interface {
GetDocument() Document
}
type DocumentStateTransformer interface {
Apply(overrideState string) error
}
type Document interface {
GetURI() string
Serializer
Loader
Validator
@ -52,6 +57,7 @@ type Document interface {
HasConfig(string) bool
GetConfig(string) Block
Apply(state string) error
Len() int
ResolveIds(ctx context.Context)
Filter(filter DeclarationSelector) []Declaration
@ -60,8 +66,11 @@ type Document interface {
CheckConstraints() bool
Failures() int
ImportedDocuments() []Document
ConfigFilter(filter BlockSelector) []Block
AppendConfigurations([]Document)
Diff(with Document, output io.Writer) (returnOutput string, diffErr error)
DiffState(output io.Writer) (returnOutput string, diffErr error)
Clone() Document
}

View File

@ -42,7 +42,7 @@ type Declaration interface {
ResolveId(context.Context) string
Loader
Validator
StateTransformer
DocumentStateTransformer
Resource() Resource
Clone() Declaration
}