All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.ktor.client.plugins.cache.storage.DisabledCacheStorage.kt Maven / Gradle / Ivy

Go to download

Ktor is a framework for quickly creating web applications in Kotlin with minimal effort.

There is a newer version: 2.2.4
Show newest version
/*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package io.ktor.client.plugins.cache.storage

import io.ktor.client.plugins.cache.*
import io.ktor.http.*

@Suppress("DEPRECATION")
internal object DisabledCacheStorage : HttpCacheStorage() {
    override fun store(url: Url, value: HttpCacheEntry) {}

    override fun find(url: Url, varyKeys: Map): HttpCacheEntry? = null

    override fun findByUrl(url: Url): Set = emptySet()
}

internal object DisabledStorage : CacheStorage {
    override suspend fun store(url: Url, data: CachedResponseData) {}
    override suspend fun find(url: Url, varyKeys: Map): CachedResponseData? = null
    override suspend fun findAll(url: Url): Set = emptySet()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy