trait Configuration extends Logging
Enhanced Typesafe Config
Extra features for Typesafe Config
It is recommended that you extend this trait in your app, in the same style, but for local configuration. For example:
trait Configuration extends net.kolotyluk.scala.extras.Configuration { config.setPathBase("net.flybynight.myapp") implicit class LocalConfiguration(val config: com.typesafe.config.Config) extends Logging { import com.typesafe.config.Config // net.flybynight.myapp.akka.system.name def getAkkaSystemName(default: Some[String] = Some("myapp")): String = config.getDefaultString("akka.system.name", default) def getRestAddress(default: Some[String] = Some("0.0.0.0")) : String = config.getDefaultString("rest.address", default) def getRestPort(default: Some[Int] = Some(8080)) : Int = config.getDefaultInt("rest.port", default, 0 to 65535) } }
Good Separation of Concerns practice would be to make your configuration code as robust as possible. You main application should not handle any configuration problems, rather all configuration troubleshooting should be in your Configuration trait. In the main body of code you might use:
val akkaSystemName = config.getAkkaSystemName() val restAddress = config.getRestAddress() val restPort = config.getRestPort()
- Alphabetic
- By Inheritance
- Configuration
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
ConfigurationError extends Error
Indicates and unrecoverable configuration problem was encountered.
Fatal Configuration Error
Indicates and unrecoverable configuration problem was encountered.
A ConfigurationError indicates an unrecoverable condition was encountered during configuration, and that the application or service should be terminated. Configuration problems are usually human error when initially setting up an application or service, so it's generally best to fail big, and fail early, so that the problem can be remedied.
-
implicit
class
ExtraConfiguration extends Logging
Implicit Local Configuration
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate() @throws( ... )
-
val
config: Config
The basic Typesafe Config with extra implicit members defined on it.
Enhanced Typesafe Config
The basic Typesafe Config with extra implicit members defined on it.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
logger: Logger
The Grizzled Logger so that we can use lazy Scala String Interpolation For example:
Grizzled Logger
The Grizzled Logger so that we can use lazy Scala String Interpolation For example:
val foo = "foo" val bar = 2 logger.debug(s"@foo $bar")
Where
s"$foo $bar"is only evaluated if logging level is "DEBUG" or higherThis is lazy so that startup messaging can work without logging failures disrupting things. For example net.kolotyluk.scala.extras.
- Definition Classes
- Logging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- object PathBase extends Logging
Leaderboard Micro Service
Akka based micro service proving general leaderboard functionality for applications such as back-end game servers.
Overview