Expose current configuration values
This commit is contained in:
15
result_value.go
Normal file
15
result_value.go
Normal 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())
|
||||
}
|
||||
Reference in New Issue
Block a user