This commit is contained in:
StellaOps Bot
2025-12-13 02:22:15 +02:00
parent 564df71bfb
commit 999e26a48e
395 changed files with 25045 additions and 2224 deletions

View File

@@ -0,0 +1,58 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using StellaOps.Messaging.Abstractions;
using StellaOps.Messaging.Plugins;
namespace StellaOps.Messaging.Transport.Valkey;
/// <summary>
/// Valkey/Redis transport plugin for StellaOps.Messaging.
/// </summary>
public sealed class ValkeyTransportPlugin : IMessagingTransportPlugin
{
/// <inheritdoc />
public string Name => "valkey";
/// <inheritdoc />
public bool IsAvailable(IServiceProvider services) => true;
/// <inheritdoc />
public void Register(MessagingTransportRegistrationContext context)
{
// Register options
context.Services.AddOptions<ValkeyTransportOptions>()
.Bind(context.GetTransportConfiguration())
.ValidateDataAnnotations()
.ValidateOnStart();
// Register connection factory
context.Services.AddSingleton<ValkeyConnectionFactory>();
// Register message queue factory
context.Services.AddSingleton<IMessageQueueFactory, ValkeyMessageQueueFactory>();
// Register cache factory
context.Services.AddSingleton<IDistributedCacheFactory, ValkeyCacheFactory>();
// Register rate limiter factory
context.Services.AddSingleton<IRateLimiterFactory, ValkeyRateLimiterFactory>();
// Register atomic token store factory
context.Services.AddSingleton<IAtomicTokenStoreFactory, ValkeyAtomicTokenStoreFactory>();
// Register sorted index factory
context.Services.AddSingleton<ISortedIndexFactory, ValkeySortedIndexFactory>();
// Register set store factory
context.Services.AddSingleton<ISetStoreFactory, ValkeySetStoreFactory>();
// Register event stream factory
context.Services.AddSingleton<IEventStreamFactory, ValkeyEventStreamFactory>();
// Register idempotency store factory
context.Services.AddSingleton<IIdempotencyStoreFactory, ValkeyIdempotencyStoreFactory>();
context.LoggerFactory?.CreateLogger<ValkeyTransportPlugin>()
.LogDebug("Registered Valkey transport plugin");
}
}