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

im.actor.server.activation.internal.ActivationConfig.scala Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package im.actor.server.activation.internal

import scala.concurrent.duration._
import scala.util.Try

import com.github.kxbmap.configs._
import com.typesafe.config.{ ConfigFactory, Config }

object ActivationConfig {
  def load(config: Config): Try[ActivationConfig] =
    for {
      limit ← config.get[Try[Duration]]("repeat-limit")
      exp ← config.get[Try[Duration]]("code-expiration")
      att ← config.get[Try[Int]]("code-attempts")
    } yield ActivationConfig(limit, exp, att)
  def load: Try[ActivationConfig] = load(ConfigFactory.load().getConfig("services.activation"))
}

case class ActivationConfig(repeatLimit: Duration, expiration: Duration, attempts: Int)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy