3 changed files with 33 additions and 1 deletions
@ -0,0 +1,23 @@ |
|||
package com.xsn.explorer.config |
|||
|
|||
import javax.inject.Inject |
|||
|
|||
import play.api.Configuration |
|||
|
|||
trait SeederConfig { |
|||
|
|||
def queueUrl: String |
|||
|
|||
def isEnabled: Boolean |
|||
} |
|||
|
|||
class PlaySeederConfig @Inject() (configuration: Configuration) extends SeederConfig { |
|||
|
|||
override def queueUrl: String = { |
|||
configuration.get[String]("seeder.queueUrl") |
|||
} |
|||
|
|||
override def isEnabled: Boolean = { |
|||
configuration.get[Boolean]("seeder.enabled") |
|||
} |
|||
} |
@ -1,11 +1,12 @@ |
|||
package com.xsn.explorer.modules |
|||
|
|||
import com.google.inject.AbstractModule |
|||
import com.xsn.explorer.config.{PlayRPCConfig, RPCConfig} |
|||
import com.xsn.explorer.config.{PlayRPCConfig, PlaySeederConfig, RPCConfig, SeederConfig} |
|||
|
|||
class ConfigModule extends AbstractModule { |
|||
|
|||
override def configure(): Unit = { |
|||
bind(classOf[RPCConfig]).to(classOf[PlayRPCConfig]) |
|||
bind(classOf[SeederConfig]).to(classOf[PlaySeederConfig]) |
|||
} |
|||
} |
|||
|
Loading…
Reference in new issue