diff --git a/internal/data/document.go b/internal/data/document.go index 8c0e9df..80792d2 100644 --- a/internal/data/document.go +++ b/internal/data/document.go @@ -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) + Diff(with Document, output io.Writer) (returnOutput string, diffErr error) + DiffState(output io.Writer) (returnOutput string, diffErr error) Clone() Document } diff --git a/internal/data/resource.go b/internal/data/resource.go index 694d2d8..d33037d 100644 --- a/internal/data/resource.go +++ b/internal/data/resource.go @@ -42,7 +42,7 @@ type Declaration interface { ResolveId(context.Context) string Loader Validator - StateTransformer + DocumentStateTransformer Resource() Resource Clone() Declaration }