Documentation
¶
Overview ¶
Package config provides the @config and @config.load directives that populate meta["config"], which OnPreprocess forwards to the compiler as a compile-time key-value map.
Typical use:
@config:strict=true
@config {
retries: 3 :cli="r,retries"
timeout: "10s" :cli="t"
}
@config.load:path="nexss.yml"
Index ¶
Constants ¶
View Source
const ID = "config"
Variables ¶
View Source
var ConfigDirective = core.Directive{
Name: "config",
Example: "@config:strict=true\n@config {\n retries: 3 :cli=\"r\"\n}",
Handler: handleConfig,
}
ConfigDirective parses both the single-line form `@config:key=value` and the block form `@config { key: value, ... }`. Each pair is written to meta["config"] under its key.
View Source
var ConfigLoadDirective = core.Directive{
Name: "config.load",
Example: `@config.load:path="nexss.yml"`,
Handler: handleConfigLoad,
}
ConfigLoadDirective parses `@config.load:path="file.yml" [prefix="x"]` and flattens the loaded document into meta["config"], joining nested keys with dots.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.