1 instantiation of RedisResource
Aspire.Hosting.Redis.Tests (1)
RedisPublicApiTests.cs (1)
155var action = () => new RedisResource(name);
46 references to RedisResource
Aspire.Hosting.Azure.Redis (11)
AzureRedisCacheResource.cs (2)
40internal RedisResource? InnerResource { get; private set; } 54internal void SetInnerResource(RedisResource innerResource)
AzureRedisExtensions.cs (8)
6using RedisResource = Aspire.Hosting.ApplicationModel.RedisResource; 26public static IResourceBuilder<RedisResource> PublishAsAzureRedis(this IResourceBuilder<RedisResource> builder) 32private static IResourceBuilder<RedisResource> PublishAsAzureRedisInternal(this IResourceBuilder<RedisResource> builder, bool useProvisioner) 85public static IResourceBuilder<RedisResource> AsAzureRedis(this IResourceBuilder<RedisResource> builder) 150Action<IResourceBuilder<RedisResource>>? configureContainer = null)
AzureRedisResource.cs (1)
14public class AzureRedisResource(RedisResource innerResource, Action<AzureResourceInfrastructure> configureInfrastructure) :
Aspire.Hosting.Redis (26)
RedisBuilderExtensions.cs (26)
39public static IResourceBuilder<RedisResource> AddRedis(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null) 43var redis = new RedisResource(name); 61.WithEndpoint(port: port, targetPort: 6379, name: RedisResource.PrimaryEndpointName) 68/// Configures a container resource for Redis Commander which is pre-configured to connect to the <see cref="RedisResource"/> that this method is used on. 73/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param> 77public static IResourceBuilder<RedisResource> WithRedisCommander(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisCommanderResource>>? configureContainer = null, string? containerName = null) 100var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); 110foreach (var redisInstance in redisInstances) 135/// Configures a container resource for Redis Insight which is pre-configured to connect to the <see cref="RedisResource"/> that this method is used on. 140/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="RedisResource"/>.</param> 144public static IResourceBuilder<RedisResource> WithRedisInsight(this IResourceBuilder<RedisResource> builder, Action<IResourceBuilder<RedisInsightResource>>? configureContainer = null, string? containerName = null) 176var redisInstances = builder.ApplicationBuilder.Resources.OfType<RedisResource>(); 204static async Task ImportRedisDatabases(ILogger resourceLogger, IEnumerable<RedisResource> redisInstances, HttpClient client, CancellationToken cancellationToken) 233foreach (var redisResource in redisInstances) 357/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 371public static IResourceBuilder<RedisResource> WithDataVolume(this IResourceBuilder<RedisResource> builder, string? name = null, bool isReadOnly = false) 387/// Use <see cref="WithPersistence(IResourceBuilder{RedisResource}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.: 401public static IResourceBuilder<RedisResource> WithDataBindMount(this IResourceBuilder<RedisResource> builder, string source, bool isReadOnly = false) 418/// Use with <see cref="WithDataBindMount(IResourceBuilder{RedisResource}, string, bool)"/> 419/// or <see cref="WithDataVolume(IResourceBuilder{RedisResource}, string?, bool)"/> to persist Redis data across sessions with custom persistence configuration, e.g.: 430public static IResourceBuilder<RedisResource> WithPersistence(this IResourceBuilder<RedisResource> builder, TimeSpan? interval = null, long keysChangedThreshold = 1)
Aspire.Hosting.Redis.Tests (9)
AddRedisTests.cs (4)
33var containerResource = Assert.Single(appModel.Resources.OfType<RedisResource>()); 61var containerResource = Assert.Single(appModel.Resources.OfType<RedisResource>());
RedisPublicApiTests.cs (5)
41IResourceBuilder<RedisResource> builder = null!; 52IResourceBuilder<RedisResource> builder = null!; 87IResourceBuilder<RedisResource> builder = null!; 98IResourceBuilder<RedisResource> builder = null!; 123IResourceBuilder<RedisResource> builder = null!;