Adopt ConfigKit v1 and Go 1.27
This commit is contained in:
@@ -9,11 +9,11 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"gitea.maximumdirect.net/eric/ConfigKit"
|
||||
"gitea.maximumdirect.net/eric/promptkit/internal/backend"
|
||||
"gitea.maximumdirect.net/eric/promptkit/internal/domain"
|
||||
"gitea.maximumdirect.net/eric/promptkit/internal/jsonvalue"
|
||||
"gitea.maximumdirect.net/eric/promptkit/internal/llm"
|
||||
"go.maximumdirect.net/configkit"
|
||||
)
|
||||
|
||||
type document struct {
|
||||
@@ -234,7 +234,7 @@ func load(main configkit.Input, underlays []configkit.Underlay) (*loaded, error)
|
||||
Path: configkit.Keys("version"),
|
||||
Check: checkConfigurationVersion,
|
||||
},
|
||||
Secret: secretProviderPath,
|
||||
Sensitive: secretProviderPath,
|
||||
Resolve: func(config *document, resolution *configkit.Resolution) error {
|
||||
for _, resources := range resourceSets(config) {
|
||||
captureFields(resources.backends, resources.bases.backends, resources.namespace, backendFields, resolution, state.backends)
|
||||
@@ -330,7 +330,7 @@ func capturePromptMetadata(prompts map[string]promptConfig, basePath configkit.P
|
||||
}
|
||||
|
||||
func captureFieldState(path configkit.Path, resolution *configkit.Resolution) fieldState {
|
||||
info, exists := resolution.InputInfo(path)
|
||||
info, exists := resolution.EntryInfo(path)
|
||||
switch {
|
||||
case !exists || !info.Explicit:
|
||||
return fieldAbsent
|
||||
@@ -345,7 +345,7 @@ func captureFields[T any](entries map[string]T, basePath configkit.Path, namespa
|
||||
for id := range entries {
|
||||
states := make(map[string]fieldState, len(fields))
|
||||
for _, field := range fields {
|
||||
info, exists := resolution.InputInfo(basePath.Key(id).Key(field))
|
||||
info, exists := resolution.EntryInfo(basePath.Key(id).Key(field))
|
||||
switch {
|
||||
case !exists || !info.Explicit:
|
||||
states[field] = fieldAbsent
|
||||
|
||||
Reference in New Issue
Block a user