typeconfig


License

License

MIT
MIT
Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

com.github.kondaurovdev
ArtifactId

ArtifactId

typeconfig_2.11
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

typeconfig
typeconfig
Project URL

Project URL

https://github.com/kondaurov-scala/typeconfig
Project Organization

Project Organization

com.github.kondaurovdev
Source Code Management

Source Code Management

https://github.com/kondaurov-scala/typeconfig.git

Download typeconfig_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.kondaurovdev/typeconfig_2.11/ -->
<dependency>
    <groupId>com.github.kondaurovdev</groupId>
    <artifactId>typeconfig_2.11</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.kondaurovdev/typeconfig_2.11/
implementation 'com.github.kondaurovdev:typeconfig_2.11:1.0.0'
// https://jarcasting.com/artifacts/com.github.kondaurovdev/typeconfig_2.11/
implementation ("com.github.kondaurovdev:typeconfig_2.11:1.0.0")
'com.github.kondaurovdev:typeconfig_2.11:jar:1.0.0'
<dependency org="com.github.kondaurovdev" name="typeconfig_2.11" rev="1.0.0">
  <artifact name="typeconfig_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.kondaurovdev', module='typeconfig_2.11', version='1.0.0')
)
libraryDependencies += "com.github.kondaurovdev" % "typeconfig_2.11" % "1.0.0"
[com.github.kondaurovdev/typeconfig_2.11 "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.8
com.typesafe.play : play-json_2.11 jar 2.5.15
com.typesafe : config jar 1.3.1

test (1)

Group / Artifact Type Version
org.specs2 : specs2-core_2.11 jar 3.8.5

Project Modules

There are no modules declared in this project.

Build Status Download

Typeconfig

Typesafe config is library that's used by akka, play, and other libraries.

This is scala library that depends on typesafe config (https://github.com/typesafehub/config)

It provides some scala api

Installation

  1. Add resolver
resolvers += Resolver.bintrayRepo("kondaurov", "maven")
  1. Add library as dependency
dependencies += "com.github.kondaurovdev" %% "typeconfig" % "1.0.0"

Usage

e.g you have applcation.conf:

{
app {
prop1 = 1
prop2 = false
}
}

Let's get this config in our application

import com.github.kondaurovdev.typeconfig.ConfigHelper
import play.api.libs.json._

val conf = ConfigHelper.load("app")

conf.right.map(_.toJsValue) == Right(Json.obj("prop1" -> 1, "prop2" -> false))

Some thoughts

I used to use another library https://github.com/kxbmap/configs That library wraps typesafe config and provides good scala api. But i understood that i dont't need this api because i it's possibe to get json representation of config and then use json library in order to cast it to scala type

com.github.kondaurovdev
There are rich ecosystem written in Scala, let's wrap some libraries and write new one!

Versions

Version
1.0.0