zio / zio-redis

A ZIO-based redis client
https://zio.github.io/zio-redis
Apache License 2.0
121 stars 63 forks source link

how to do redis-cli --tls through the code #958

Closed alek-w closed 1 month ago

alek-w commented 3 months ago

redis-cli -h master.somethng-somethng-somethng.somethng.amazonaws.com -p 6379 --tls -a passss

could you tell pls how to do the same through the code?

https://github.com/zio/zio-redis/blob/master/modules/redis/src/main/scala/zio/redis/api/Connection.scala#L36

victornguen commented 3 months ago

You can authorize in Redis after constructing your ZLayer containing Redis. For example:

Redis.singleNode.tap { redis: ZEnvironment[Redis] =>
    ZIO.attempt {
      redis.get.auth("password")
    }
  }