IUnlockManager теперь IVault
This commit is contained in:
@@ -2,5 +2,6 @@ package com.github.nullptroma.wallenc.domain.enums
|
||||
|
||||
enum class VaultType {
|
||||
LOCAL,
|
||||
DECRYPTED,
|
||||
YANDEX
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import java.util.UUID
|
||||
|
||||
interface IUnlockManager {
|
||||
interface IUnlockManager: IVault {
|
||||
/**
|
||||
* Хранилища, для которых есть ключ шифрования
|
||||
*/
|
||||
@@ -12,4 +12,5 @@ interface IUnlockManager {
|
||||
|
||||
suspend fun open(storage: IStorage, key: EncryptKey): IStorage
|
||||
suspend fun close(storage: IStorage)
|
||||
suspend fun close(uuid: UUID): Unit
|
||||
}
|
||||
@@ -4,8 +4,9 @@ import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
interface IVaultsManager {
|
||||
val localVault: IVault
|
||||
val unlockManager: IUnlockManager
|
||||
val remoteVaults: StateFlow<List<IVault>>
|
||||
|
||||
val allStorages: StateFlow<List<IStorage>>
|
||||
val allVaults: StateFlow<List<IVault>>
|
||||
fun addYandexVault(email: String, token: String)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.github.nullptroma.wallenc.domain.usecases
|
||||
|
||||
import com.github.nullptroma.wallenc.domain.interfaces.IStorage
|
||||
import com.github.nullptroma.wallenc.domain.interfaces.IStorageInfo
|
||||
|
||||
class RemoveStorageUseCase {
|
||||
suspend fun rename(storage: IStorageInfo, newName: String) {
|
||||
when (storage) {
|
||||
is IStorage -> storage.rename(newName)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user