Exemple #1
0
        private static void SetupEnvironment(IVostokHostingEnvironmentBuilder builder)
        {
            builder.SetupApplicationIdentity(
                id =>
            {
                id.SetProject("infra");
                id.SetApplication("vostok-test");
                id.SetEnvironment("dev");
                id.SetInstance("the only one");
            });

            builder.SetupLog(log => log.SetupConsoleLog());

            builder.SetupConfiguration(
                config =>
            {
                config.AddSource(new ObjectSource(new {}));
                config.AddSecretSource(new ObjectSource(new {}));
            });

            builder.SetupClusterConfigClient(config =>
                                             config.CustomizeSettings(setting => setting.EnableClusterSettings = false));
        }
 /// <summary>
 /// Enables remote (cluster) settings for ClusterConfig client.
 /// </summary>
 public static IVostokHostingEnvironmentBuilder EnableClusterConfigRemoteSettings([NotNull] this IVostokHostingEnvironmentBuilder builder) =>
 builder.SetupClusterConfigClient(
     clusterConfigBuilder => clusterConfigBuilder.CustomizeSettings(
         settings => { settings.EnableClusterSettings = true; }));
 /// <summary>
 /// Disables local settings for ClusterConfig client.
 /// </summary>
 public static IVostokHostingEnvironmentBuilder DisableClusterConfigLocalSettings([NotNull] this IVostokHostingEnvironmentBuilder builder) =>
 builder.SetupClusterConfigClient(
     clusterConfigBuilder => clusterConfigBuilder.CustomizeSettings(
         settings => { settings.EnableLocalSettings = false; }));