public static IOutkeepServerBuilder AddNullGrainStorageAsDefault(this IOutkeepServerBuilder builder)
 {
     return(builder.ConfigureServices(services =>
     {
         services.AddNullGrainStorageAsDefault();
     }));
 }
 public static IOutkeepServerBuilder AddNullGrainStorage(this IOutkeepServerBuilder builder, string name)
 {
     return(builder.ConfigureServices(services =>
     {
         services.AddNullGrainStorage(name);
     }));
 }
Ejemplo n.º 3
0
 public static IOutkeepServerBuilder AddCoreServices(this IOutkeepServerBuilder builder)
 {
     return(builder
            .ConfigureSilo(silo =>
     {
         silo.AddOutkeep();
     }));
 }
        public static IOutkeepServerBuilder ConfigureSilo(this IOutkeepServerBuilder builder, Action <ISiloBuilder> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(builder.ConfigureSilo((context, silo) => configure(silo)));
        }
        public static IOutkeepServerBuilder ConfigureServices(this IOutkeepServerBuilder builder, Action <IServiceCollection> configure)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (configure is null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(builder.ConfigureServices((context, services) => configure(services)));
        }
        /// <summary>
        /// Sets up an Outkeep HTTP API on this <see cref="IOutkeepServerBuilder"/> instance.
        /// Successive calls to this extension method are cumulative and will only create a single API instance.
        /// </summary>
        public static IOutkeepServerBuilder UseHttpApi(this IOutkeepServerBuilder outkeep, Action <OutkeepHttpApiServerOptions> configure)
        {
            if (outkeep == null)
            {
                throw new ArgumentNullException(nameof(outkeep));
            }

            return(outkeep.ConfigureServices((context, services) =>
            {
                services.TryAddHostedService <OutkeepHttpApiHostedService>();
                services.AddOptions <OutkeepHttpApiServerOptions>()
                .Configure(configure)
                .ValidateDataAnnotations();
            }));
        }
        public static IOutkeepServerBuilder Configure <TOptions>(this IOutkeepServerBuilder builder, Action <TOptions> configure) where TOptions : class
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (configure is null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(builder.ConfigureServices(services =>
            {
                services.Configure(configure);
            }));
        }
Ejemplo n.º 8
0
        public static IOutkeepServerBuilder UseStandaloneClustering(
            this IOutkeepServerBuilder outkeep,
            int siloPort     = 11111,
            int gatewayPort  = 30000,
            string serviceId = "dev",
            string clusterId = "dev",
            bool searchPorts = false)
        {
            if (outkeep == null)
            {
                throw new ArgumentNullException(nameof(outkeep));
            }

            outkeep.ConfigureSilo((context, silo) =>
            {
                var actualSiloPort    = searchPorts ? TcpHelper.Default.GetFreePort(siloPort) : siloPort;
                var actualGatewayPort = searchPorts ? TcpHelper.Default.GetFreePort(gatewayPort) : gatewayPort;

                silo.UseLocalhostClustering(actualSiloPort, actualGatewayPort, new IPEndPoint(IPAddress.Loopback, siloPort), serviceId, clusterId);
            });

            return(outkeep);
        }
Ejemplo n.º 9
0
 public static IOutkeepServerBuilder UseAzure(this IOutkeepServerBuilder builder)
 {
     return(builder.ConfigureServices(services =>
     {
     }));
 }