Replace Probe with Agent across node runtime, Fleet contracts, backend state, API and storage. Report incoming sessions and outgoing link health through each Agent uplink, and retain directed link controls and retry. Update protocol fixtures and end-to-end coverage for the unified model; accept requested cancellation during the Fleet timeout test cleanup.
33 lines
1.7 KiB
C#
33 lines
1.7 KiB
C#
using Fleet.Server;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using MoShiro.Backend.Application;
|
|
|
|
namespace MoShiro.Backend.Storage.Sqlite;
|
|
|
|
public static class StorageServiceCollectionExtensions
|
|
{
|
|
/// <summary>注册 SQLite + 段文件存储:实现 Application 的全部存储端口,同时实现 Fleet 的 <see cref="IFleetStore"/>。</summary>
|
|
public static IServiceCollection AddMoShiroSqlite(this IServiceCollection services, string dataDirectory)
|
|
{
|
|
services.AddSingleton(_ => new SqliteDatabase(dataDirectory));
|
|
services.AddSingleton<SqliteAgentStore>();
|
|
services.AddSingleton<IAgentStore>(p => p.GetRequiredService<SqliteAgentStore>());
|
|
services.AddSingleton<IFleetStore>(p => p.GetRequiredService<SqliteAgentStore>());
|
|
services.AddSingleton<IJoinTokenStore, SqliteJoinTokenStore>();
|
|
services.AddSingleton<ISettingsStore, SqliteSettingsStore>();
|
|
services.AddSingleton<ITaskStore, SqliteTaskStore>();
|
|
services.AddSingleton<ITestStore, SqliteTestStore>();
|
|
services.AddSingleton<IEventStore, SqliteEventStore>();
|
|
services.AddSingleton<IHostStore, SqliteHostStore>();
|
|
services.AddSingleton<INodeMetaStore, SqliteNodeMetaStore>();
|
|
services.AddSingleton<IAuthStore, SqliteAuthStore>();
|
|
services.AddSingleton<IAuditStore, SqliteAuditStore>();
|
|
services.AddSingleton<IOperatorSetStore, SqliteOperatorSetStore>();
|
|
services.AddSingleton<IRawStore, SqliteRawStore>();
|
|
services.AddSingleton<IMetricStore, SqliteMetricStore>();
|
|
services.AddSingleton<IStorageHealth, SqliteStorageHealth>();
|
|
services.AddSingleton<IDatabaseBackup, SqliteDatabaseBackup>();
|
|
return services;
|
|
}
|
|
}
|