PluginMetadataManager

プラグインメタデータの管理を行うインターフェース metadata/xxx.yamlファイルの作成・更新・読み込み・保存を担当する

Functions

Link copied to clipboard
abstract suspend fun createMetadata(pluginName: String, repository: RepositoryConfig, versionData: VersionData, action: String = "add", channel: String? = null): Either<String, ManagedPluginDto>

新しいプラグインのメタデータを作成する

Link copied to clipboard
abstract fun deleteMetadata(pluginName: String): Either<String, Unit>

プラグインメタデータファイルを削除する

Link copied to clipboard
abstract fun ensureMetadataReplaceable(pluginName: String): Either<String, Unit>

メタデータファイルを退避して作り直してよいかを事前に判定する(副作用なし)

Link copied to clipboard
abstract fun loadMetadata(pluginName: String): Either<String, ManagedPluginDto>

メタデータファイルからプラグインメタデータを読み込む

Link copied to clipboard
abstract fun quarantineMetadata(pluginName: String): Either<String, File?>

読み込めなくなったメタデータファイルを退避(隔離)する

Link copied to clipboard
abstract suspend fun recordCheckResult(pluginName: String, latestVersion: String): Either<String, Boolean>

更新チェックの結果をメタデータへ記録する

Link copied to clipboard
abstract fun restoreQuarantinedMetadata(pluginName: String, quarantinedFile: File): Either<String, Unit>

退避(隔離)したメタデータファイルを元の場所へ戻す

Link copied to clipboard
abstract fun saveMetadata(pluginName: String, metadata: ManagedPluginDto): Either<String, Unit>

プラグインメタデータをファイルに保存する

Link copied to clipboard
abstract suspend fun updateMetadata(pluginName: String, versionData: VersionData, latestVersionData: VersionData, action: String = "update"): Either<String, ManagedPluginDto>

既存のメタデータを更新する

Link copied to clipboard
abstract suspend fun <T> withMetadataLock(pluginName: String, block: suspend () -> T): T

1つのプラグインのメタデータに対する「読み込み→加工→保存」を直列化する