Restore public API reference documentation

This commit is contained in:
2026-09-12 17:24:44 +00:00
parent 6102b36adf
commit c98435ce8e
5 changed files with 32 additions and 8 deletions

View File

@@ -13,13 +13,15 @@ type Source struct{ value engine.Source }
// File returns a source that reopens path for every load attempt.
func File(path string) Source { return Source{value: engine.File(path)} }
// Bytes snapshots data immediately.
// Bytes snapshots data immediately. Label must be nonempty and safe to display;
// constructor problems are reported when the source is consumed.
func Bytes(label string, data []byte) Source { return Source{value: engine.Bytes(label, data)} }
// Reader returns a single-use source. Copies share the same single-use claim.
// Reader returns a single-use source. ConfigKit consumes input but never closes it.
// Copies of the returned Source share the same single-use claim.
func Reader(label string, input io.Reader) Source { return Source{value: engine.Reader(label, input)} }
// NoSource explicitly selects defaults-only input.
// NoSource explicitly selects a defaults-only input. It creates no source record.
func NoSource() Source { return Source{value: engine.NoSource()} }
func (s Source) toEngine() engine.Source { return s.value }