Define typed producer assessment and native execution dependencies
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
configkit "go.maximumdirect.net/configkit"
|
||||
)
|
||||
@@ -449,21 +450,21 @@ func sortedDocumentKeys[T any](values map[string]T) []string {
|
||||
sort.Strings(keys)
|
||||
return keys
|
||||
}
|
||||
func normalizeDocumentControls(mode **pipeline.ExecutionMode, cache **pipeline.CacheMode, path configkit.Path, resolution documentNormalizer) {
|
||||
func normalizeDocumentControls(mode **contracts.ExecutionMode, cache **contracts.CacheMode, path configkit.Path, resolution documentNormalizer) {
|
||||
if *mode != nil {
|
||||
value := pipeline.ExecutionMode(strings.TrimSpace(string(**mode)))
|
||||
value := contracts.ExecutionMode(strings.TrimSpace(string(**mode)))
|
||||
if **mode != value {
|
||||
normalizeDocumentValue(resolution, path.Key("mode"), mode, &value, "trimmed execution mode")
|
||||
}
|
||||
}
|
||||
if *cache != nil {
|
||||
value := pipeline.CacheMode(strings.TrimSpace(string(**cache)))
|
||||
value := contracts.CacheMode(strings.TrimSpace(string(**cache)))
|
||||
if **cache != value {
|
||||
normalizeDocumentValue(resolution, path.Key("cache"), cache, &value, "trimmed cache mode")
|
||||
}
|
||||
}
|
||||
}
|
||||
func validateDocumentControls(mode *pipeline.ExecutionMode, turns *int, cache *pipeline.CacheMode, path configkit.Path, validation *configkit.Validation) {
|
||||
func validateDocumentControls(mode *contracts.ExecutionMode, turns *int, cache *contracts.CacheMode, path configkit.Path, validation *configkit.Validation) {
|
||||
if mode != nil {
|
||||
if _, err := pipeline.ParseExecutionMode(string(*mode)); err != nil {
|
||||
validation.Error(path.Key("mode"), err.Error())
|
||||
|
||||
Reference in New Issue
Block a user