add document state transformer interface
This commit is contained in:
parent
614b4426c2
commit
452695c8f5
@ -32,7 +32,12 @@ type DocumentGetter interface {
|
|||||||
GetDocument() Document
|
GetDocument() Document
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DocumentStateTransformer interface {
|
||||||
|
Apply(overrideState string) error
|
||||||
|
}
|
||||||
|
|
||||||
type Document interface {
|
type Document interface {
|
||||||
|
GetURI() string
|
||||||
Serializer
|
Serializer
|
||||||
Loader
|
Loader
|
||||||
Validator
|
Validator
|
||||||
@ -52,6 +57,7 @@ type Document interface {
|
|||||||
HasConfig(string) bool
|
HasConfig(string) bool
|
||||||
GetConfig(string) Block
|
GetConfig(string) Block
|
||||||
|
|
||||||
|
Apply(state string) error
|
||||||
Len() int
|
Len() int
|
||||||
ResolveIds(ctx context.Context)
|
ResolveIds(ctx context.Context)
|
||||||
Filter(filter DeclarationSelector) []Declaration
|
Filter(filter DeclarationSelector) []Declaration
|
||||||
@ -60,8 +66,11 @@ type Document interface {
|
|||||||
CheckConstraints() bool
|
CheckConstraints() bool
|
||||||
Failures() int
|
Failures() int
|
||||||
|
|
||||||
|
ImportedDocuments() []Document
|
||||||
|
|
||||||
ConfigFilter(filter BlockSelector) []Block
|
ConfigFilter(filter BlockSelector) []Block
|
||||||
AppendConfigurations([]Document)
|
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
|
Clone() Document
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ type Declaration interface {
|
|||||||
ResolveId(context.Context) string
|
ResolveId(context.Context) string
|
||||||
Loader
|
Loader
|
||||||
Validator
|
Validator
|
||||||
StateTransformer
|
DocumentStateTransformer
|
||||||
Resource() Resource
|
Resource() Resource
|
||||||
Clone() Declaration
|
Clone() Declaration
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user