Add reference catalog selection to pipeline configuration

This commit is contained in:
2026-11-27 16:12:16 +00:00
parent 66b7674e43
commit 5d44b41e74
7 changed files with 146 additions and 33 deletions

View File

@@ -0,0 +1,24 @@
package config
import "fmt"
// SelectSetting returns the source for a selected setting, or no source for an omitted selection.
func (catalog ReferenceCatalogConfig) SelectSetting(id string) (string, error) {
return selectReference("setting", id, catalog.Settings)
}
// SelectSystem returns the source for a selected system, or no source for an omitted selection.
func (catalog ReferenceCatalogConfig) SelectSystem(id string) (string, error) {
return selectReference("system", id, catalog.Systems)
}
func selectReference(kind, id string, entries map[string]string) (string, error) {
if id == "" {
return "", nil
}
path, ok := entries[id]
if !ok {
return "", fmt.Errorf("unknown reference catalog %s %q", kind, id)
}
return path, nil
}