Documentation
¶
Overview ¶
Package configini reads INI configuration through the config codec seam.
It is a sibling of the config core, not part of it, and adds no dependency at all — an INI file is read with the standard library.
config.NewStore(ctx, config.WithFiles(fsys, "/etc/app.yaml"), // YAML, the default config.WithBackend(configini.New(fsys, "/etc/app.ini")), )
Sections and keys nest on dots ¶
A `[section]` header prefixes the keys beneath it, so
[server] host = localhost
reads as server.host. Both a section name and a key may themselves contain dots, and each dot is a nesting separator: `[db.primary]` with `pool.size = 4` reads as db.primary.pool.size. Keys before any section are top-level.
A line is `key = value` or `key : value`; `;` and `#` begin a comment; surrounding single or double quotes are stripped from a value. The format is read-only, and values are strings that the read path casts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Codec ¶ added in v0.2.0
type Codec struct{}
Codec decodes INI sections and keys into layer values. New uses it, and it is exported so a backend adapter can reuse it as a value decoder — a key whose value is an INI document, decoded via that adapter's WithValueCodec option. It is a config.Codec.