extensions.md 1.6 KB

Extension Methods

Extension methods for various configuration sources and features.

Configuration Sources

JSON

builder.AddJson(path, level, writeable, optional, reloadOnChange, isPrimaryWriter)

YAML (Apq.Cfg.Yaml)

builder.AddYaml(path, level, writeable, optional, reloadOnChange, isPrimaryWriter)

XML (Apq.Cfg.Xml)

builder.AddXml(path, level, writeable, optional, reloadOnChange, isPrimaryWriter)

INI (Apq.Cfg.Ini)

builder.AddIni(path, level, writeable, optional, reloadOnChange, isPrimaryWriter)

TOML (Apq.Cfg.Toml)

builder.AddToml(path, level, writeable, optional, reloadOnChange, isPrimaryWriter)

Environment Variables

builder.AddEnvironmentVariables(level, prefix)

Remote Sources

Consul (Apq.Cfg.Consul)

builder.AddConsul(options => { }, level, writeable, reloadOnChange)

Nacos (Apq.Cfg.Nacos)

builder.AddNacos(options => { }, level, reloadOnChange)

Vault (Apq.Cfg.Vault)

builder.AddVault(options => { }, level)

Encryption (Apq.Cfg.Crypto)

AES-GCM

builder.AddAesGcmEncryption(base64Key)
builder.AddAesGcmEncryptionFromEnv(envVarName)

Masking

builder.AddSensitiveMasking()
builder.AddSensitiveMasking(options => { })

DI Integration

Service Registration

services.AddApqCfg(builder => { })

Options Configuration

services.ConfigureApqCfg<TOptions>(sectionPath)

Next Steps