Get configuration for your c# applications easily.
To connect to FastConfig you need
AddressAppId- unique application nameToken- token created for a specific AppId or a master token
var fastConfig = new FastConfigClient(
address: address,
appId: appId,
token: token
);Connection configuration is stored in following environment variables:
FASTCONFIG_ADDRESSFASTCONFIG_APPIDFASTCONFIG_TOKEN
By passing a parameter you can override the env variable. In this case Address and Token are storen in environment variables and AppId is stored in code.
var fastConfig = FastConfigClient.FromEnvironment(
appId: appId,
);Get configuration deserialized into your type.
var appConfig = await fastConfig.Get<YourConfig>();Get configuration as a string.
string appConfig = await fastConfig.Get();Send a class instance.
var config = new AnyClass();
await fastConfig.Send(config);Send a string. The string must be a valid json.
await fastConfig.Send("{\"foo\": \"bar\"}");You can add a FastConfig client to services using AddFastConfig.
var fastConfig = FastConfigClient.FromEnvironment();
...
services.AddFastConfig(fastConfig);