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

coursier.internal.InMemoryCache.scala Maven / Gradle / Ivy

There is a newer version: 2.1.25-M3
Show newest version
package coursier.internal

import java.io.File

import coursier.cache.{ArtifactError, Cache, CacheLogger}
import coursier.util.{Artifact, EitherT, Sync}

import scala.concurrent.ExecutionContext
import dataclass.data

@data class InMemoryCache[F[_]](underlying: Cache[F], S: Sync[F]) extends Cache[F] {

  private implicit def S0: Sync[F] = S

  def fetch: Cache.Fetch[F] =
    new InMemoryCachingFetcher(underlying.fetch).fetcher

  def file(artifact: Artifact): EitherT[F, ArtifactError, File] =
    underlying.file(artifact)

  def ec: ExecutionContext =
    underlying.ec

  override def loggerOpt: Option[CacheLogger] =
    underlying.loggerOpt
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy