2026-11-29 16:31:19 +00:00
|
|
|
// Package validation supports the repository's internal contract checks.
|
2026-11-28 19:44:30 +00:00
|
|
|
package validation
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
2026-11-29 16:31:19 +00:00
|
|
|
"go.maximumdirect.net/configkit"
|
2026-11-28 19:44:30 +00:00
|
|
|
)
|
|
|
|
|
|
2026-11-29 16:31:19 +00:00
|
|
|
// LoadDomain acquires a completed domain mapping through the pinned native
|
|
|
|
|
// ConfigKit boundary. Schema and semantic validation consume its result directly.
|
|
|
|
|
func LoadDomain(label string, data []byte) (map[string]any, error) {
|
|
|
|
|
result, err := configkit.Load[map[string]any](configkit.Bytes(label, data))
|
2026-11-28 23:25:12 +00:00
|
|
|
if err != nil {
|
2026-11-29 16:31:19 +00:00
|
|
|
return nil, fmt.Errorf("load: %w", err)
|
2026-11-28 19:44:30 +00:00
|
|
|
}
|
2026-11-29 16:31:19 +00:00
|
|
|
return result.Config, nil
|
2026-11-28 19:44:30 +00:00
|
|
|
}
|