mules-http4s-redis


License

License

MIT
Categories

Categories

Redis Data Databases
GroupId

GroupId

io.chrisdavenport
ArtifactId

ArtifactId

mules-http4s-redis_2.12
Last Version

Last Version

0.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

mules-http4s-redis
mules-http4s-redis
Project URL

Project URL

https://github.com/ChristopherDavenport/mules-http4s-redis
Project Organization

Project Organization

io.chrisdavenport
Source Code Management

Source Code Management

https://github.com/ChristopherDavenport/mules-http4s-redis

Download mules-http4s-redis_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/io.chrisdavenport/mules-http4s-redis_2.12/ -->
<dependency>
    <groupId>io.chrisdavenport</groupId>
    <artifactId>mules-http4s-redis_2.12</artifactId>
    <version>0.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/io.chrisdavenport/mules-http4s-redis_2.12/
implementation 'io.chrisdavenport:mules-http4s-redis_2.12:0.0.4'
// https://jarcasting.com/artifacts/io.chrisdavenport/mules-http4s-redis_2.12/
implementation ("io.chrisdavenport:mules-http4s-redis_2.12:0.0.4")
'io.chrisdavenport:mules-http4s-redis_2.12:jar:0.0.4'
<dependency org="io.chrisdavenport" name="mules-http4s-redis_2.12" rev="0.0.4">
  <artifact name="mules-http4s-redis_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.chrisdavenport', module='mules-http4s-redis_2.12', version='0.0.4')
)
libraryDependencies += "io.chrisdavenport" % "mules-http4s-redis_2.12" % "0.0.4"
[io.chrisdavenport/mules-http4s-redis_2.12 "0.0.4"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11
io.chrisdavenport : mules-http4s-scodec_2.12 jar 0.2.0-M3
io.chrisdavenport : mules-redis_2.12 jar 0.3.0

test (4)

Group / Artifact Type Version
org.specs2 : specs2-core_2.12 jar 4.10.0
com.codecommit : cats-effect-testing-specs2_2.12 jar 0.3.0
io.chrisdavenport : testcontainers-specs2_2.12 jar 0.2.0-M2
org.specs2 : specs2-scalacheck_2.12 jar 4.10.0

Project Modules

There are no modules declared in this project.

mules-http4s-redis - Mules Http4s Integration for Redis Build Status Maven Central Code of Consuct

Head on over to the microsite

Quick Start

To use mules-http4s-redis in an existing SBT project with Scala 2.11 or a later version, add the following dependencies to your build.sbt depending on your needs:

libraryDependencies ++= Seq(
  "io.chrisdavenport" %% "mules-http4s-redis" % "<version>"
)

To create a client, simply use the redis tools available from other components. This serves as the Codec which allows the other mules-redis, and mules-http4s to interact together.

import io.chrisdavenport.mules.redis.RedisCache
import org.http4s._
import io.chrisdavenport.mules.http4s._
import dev.profunktor.redis4cats.Redis
import dev.profunktor.redis4cats.connection.{ RedisClient, RedisURI }

def makeCache(defaultTimeout: Option[TimeSpec], connectString: String) : Resource[IO, Cache[IO, (Method, Uri), CacheItem]] = for {
    uri <- Resource.liftF(RedisURI.make[IO](connectString)) // Something like s"redis://$server:$port"
    client <- RedisClient[IO](uri)
    redis <- Redis[IO].fromClient(client,  RedisHttpCodec.CacheKeyWithItem)
    cache = RedisCache.fromCommands(redis, defaultTimeout)
  } yield cache

Versions

Version
0.0.4
0.0.3
0.0.1