io.github.nafg.messaging.SmsService.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-messaging_2.13 Show documentation
Show all versions of zio-messaging_2.13 Show documentation
ZIO wrappers for messaging APIs
The newest version!
package io.github.nafg.messaging
import io.github.nafg.scalaphonenumber.PhoneNumber
import zio.{Task, ULayer, ZIO, ZLayer}
trait SmsService {
def sendMessage(to: PhoneNumber, message: String): Task[Unit]
}
object SmsService {
object NoOp extends SmsService {
override def sendMessage(to: PhoneNumber, message: String): Task[Unit] = ZIO.unit
val layer: ULayer[SmsService] = ZLayer.succeed(NoOp)
}
}