Expose current configuration values

This commit is contained in:
2026-11-21 04:05:27 +00:00
parent 654fe9d306
commit f514936c9c
3 changed files with 141 additions and 1 deletions

15
result_value.go Normal file
View File

@@ -0,0 +1,15 @@
package configkit
import "go.maximumdirect.net/configkit/internal/engine"
// Value returns the current Config value at path, including values absent from
// input. It returns false for a nil result, invalid path, or missing value.
// Values are trusted application data and may include resolved secrets. Ordinary
// Go assignment applies: maps, slices, and pointers can alias Config. Inspection
// methods continue to report the frozen completed load, not later mutations.
func (r *Result[T]) Value(path Path) (any, bool) {
if r == nil {
return nil, false
}
return engine.ResultValue(r.Config, toEnginePath(path), secretBinding())
}