public static IWebSocketGremlinQueryEnvironmentBuilder Configure(this IWebSocketGremlinQueryEnvironmentBuilder builder, IConfiguration configuration) { var authenticationSection = configuration.GetSection("Authentication"); var connectionPoolSection = configuration.GetSection("ConnectionPool"); builder = builder .At(configuration.GetRequiredConfiguration("Uri")) .ConfigureConnectionPool(connectionPoolSettings => { if (int.TryParse(connectionPoolSection[$"{nameof(ConnectionPoolSettings.MaxInProcessPerConnection)}"], out var maxInProcessPerConnection)) { connectionPoolSettings.MaxInProcessPerConnection = maxInProcessPerConnection; } if (int.TryParse(connectionPoolSection[$"{nameof(ConnectionPoolSettings.PoolSize)}"], out var poolSize)) { connectionPoolSettings.PoolSize = poolSize; } }); if (configuration["Alias"] is { } alias) { builder = builder.SetAlias(alias); } if (authenticationSection["Username"] is { } username&& authenticationSection["Password"] is { } password) { builder = builder.AuthenticateBy(username, password); } if (Enum.TryParse <SerializationFormat>(configuration[$"{nameof(SerializationFormat)}"], out var graphsonVersion)) { builder = builder.SetSerializationFormat(graphsonVersion); } return(new LogConfigurationWebSocketGremlinQueryEnvironmentBuilder(builder, configuration)); }
public ICosmosDbConfigurationBuilderWithUri At(Uri uri, string databaseName, string graphName) { return(new CosmosDbConfigurationBuilder(_webSocketBuilder.At(uri), $"/dbs/{databaseName}/colls/{graphName}")); }
public static IWebSocketGremlinQueryEnvironmentBuilder At(this IWebSocketGremlinQueryEnvironmentBuilder builder, string uri) { return(builder.At(new Uri(uri))); }
IWebSocketGremlinQueryEnvironmentBuilder IWebSocketGremlinQueryEnvironmentBuilder.At(Uri uri) { return(_baseBuilder.At(uri)); }
public static IWebSocketGremlinQueryEnvironmentBuilder AtLocalhost(this IWebSocketGremlinQueryEnvironmentBuilder builder) { return(builder.At(new Uri("ws://localhost:8182"))); }