Add a CacheStore module.

This commit is contained in:
Benoit Marty 2026-04-29 16:39:07 +02:00 committed by Benoit Marty
parent ea1ccbf806
commit c86532778c
15 changed files with 374 additions and 0 deletions

View file

@ -0,0 +1,13 @@
/*
* Copyright (c) 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
plugins {
id("io.element.android-library")
}
android {
namespace = "io.element.android.libraries.cachestore.api"
}

View file

@ -0,0 +1,13 @@
/*
* Copyright (c) 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.cachestore.api
data class CacheData(
val value: String,
val updatedAt: Long,
)

View file

@ -0,0 +1,14 @@
/*
* Copyright (c) 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.libraries.cachestore.api
interface CacheStore {
suspend fun storeData(key: String, data: CacheData)
suspend fun getData(key: String): CacheData?
suspend fun deleteData(key: String)
}