diff options
| author | 2026-03-06 10:52:02 +0800 | |
|---|---|---|
| committer | 2026-03-06 10:53:37 +0800 | |
| commit | f36918966727be99bfe9d461059269f36f92058a (patch) | |
| tree | ff2c6545d369a74c210574f821298181307c701a /config/entry.go | |
| parent | objecttype: Split files (diff) | |
| signature | No signature | |
config: Split files
Diffstat (limited to 'config/entry.go')
| -rw-r--r-- | config/entry.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/config/entry.go b/config/entry.go new file mode 100644 index 00000000..a2a39965 --- /dev/null +++ b/config/entry.go @@ -0,0 +1,25 @@ +package config + +// ConfigEntry represents a single parsed configuration directive. +type ConfigEntry struct { + // The section name in canonical lowercase form. + Section string + // The subsection name, retaining the exact form parsed from the input. + Subsection string + // The key name in canonical lowercase form. + Key string + // Kind records whether this entry has no value or an explicit value. + Kind ValueKind + // The interpreted value of the configuration entry, including unescaped + // characters where appropriate. + Value string +} + +// Entries returns a copy of all parsed configuration entries in the order they +// appeared. Modifying the returned slice does not affect the Config. +func (c *Config) Entries() []ConfigEntry { + result := make([]ConfigEntry, len(c.entries)) + copy(result, c.entries) + + return result +} |
