1 instantiation of RedisResource
Aspire.Hosting.Redis.Tests (1)
RedisPublicApiTests.cs (1)
155
var action = () => new
RedisResource
(name);
46 references to RedisResource
Aspire.Hosting.Azure.Redis (11)
AzureRedisCacheResource.cs (2)
36
internal
RedisResource
? InnerResource { get; private set; }
50
internal void SetInnerResource(
RedisResource
innerResource)
AzureRedisExtensions.cs (8)
6
using RedisResource = Aspire.Hosting.ApplicationModel.
RedisResource
;
27
public static IResourceBuilder<
RedisResource
> PublishAsAzureRedis(this IResourceBuilder<
RedisResource
> builder)
33
private static IResourceBuilder<
RedisResource
> PublishAsAzureRedisInternal(this IResourceBuilder<
RedisResource
> builder, bool useProvisioner)
87
public static IResourceBuilder<
RedisResource
> AsAzureRedis(this IResourceBuilder<
RedisResource
> builder)
180
Action<IResourceBuilder<
RedisResource
>>? configureContainer = null)
AzureRedisResource.cs (1)
14
public class AzureRedisResource(
RedisResource
innerResource, Action<AzureResourceInfrastructure> configureInfrastructure) :
Aspire.Hosting.Redis (26)
RedisBuilderExtensions.cs (26)
39
public static IResourceBuilder<
RedisResource
> AddRedis(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null)
43
var
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>
77
public static IResourceBuilder<
RedisResource
> WithRedisCommander(this IResourceBuilder<
RedisResource
> builder, Action<IResourceBuilder<RedisCommanderResource>>? configureContainer = null, string? containerName = null)
100
var redisInstances = builder.ApplicationBuilder.Resources.OfType<
RedisResource
>();
110
foreach (
var
redisInstance in redisInstances)
133
/// Configures a container resource for Redis Insight which is pre-configured to connect to the <see cref="
RedisResource
"/> that this method is used on.
138
/// <param name="builder">The <see cref="IResourceBuilder{T}"/> for the <see cref="
RedisResource
"/>.</param>
142
public static IResourceBuilder<
RedisResource
> WithRedisInsight(this IResourceBuilder<
RedisResource
> builder, Action<IResourceBuilder<RedisInsightResource>>? configureContainer = null, string? containerName = null)
174
var redisInstances = builder.ApplicationBuilder.Resources.OfType<
RedisResource
>();
202
static async Task ImportRedisDatabases(ILogger resourceLogger, IEnumerable<
RedisResource
> redisInstances, HttpClient client, CancellationToken cancellationToken)
231
foreach (
var
redisResource in redisInstances)
355
/// Use <see cref="WithPersistence(IResourceBuilder{
RedisResource
}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
369
public static IResourceBuilder<
RedisResource
> WithDataVolume(this IResourceBuilder<
RedisResource
> builder, string? name = null, bool isReadOnly = false)
385
/// Use <see cref="WithPersistence(IResourceBuilder{
RedisResource
}, TimeSpan?, long)"/> to adjust Redis persistence configuration, e.g.:
399
public static IResourceBuilder<
RedisResource
> WithDataBindMount(this IResourceBuilder<
RedisResource
> builder, string source, bool isReadOnly = false)
416
/// Use with <see cref="WithDataBindMount(IResourceBuilder{
RedisResource
}, string, bool)"/>
417
/// or <see cref="WithDataVolume(IResourceBuilder{
RedisResource
}, string?, bool)"/> to persist Redis data across sessions with custom persistence configuration, e.g.:
428
public static IResourceBuilder<
RedisResource
> WithPersistence(this IResourceBuilder<
RedisResource
> builder, TimeSpan? interval = null, long keysChangedThreshold = 1)
Aspire.Hosting.Redis.Tests (9)
AddRedisTests.cs (4)
33
var
containerResource = Assert.Single(appModel.Resources.OfType<
RedisResource
>());
61
var
containerResource = Assert.Single(appModel.Resources.OfType<
RedisResource
>());
RedisPublicApiTests.cs (5)
41
IResourceBuilder<
RedisResource
> builder = null!;
52
IResourceBuilder<
RedisResource
> builder = null!;
87
IResourceBuilder<
RedisResource
> builder = null!;
98
IResourceBuilder<
RedisResource
> builder = null!;
123
IResourceBuilder<
RedisResource
> builder = null!;