コード例 #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));
        }
コード例 #2
0
 /// <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; }));
コード例 #3
0
 /// <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; }));