File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ Creating a simple HTTP server is as easy as this:
9
9
10
10
#### build.sbt
11
11
12
- ![ GitHub tag (latest SemVer) ] ( https://img.shields.io/github /v/tag/ avast/scala-server-toolkit?label=version&sort=semver )
12
+ ![ Maven Central ] ( https://img.shields.io/maven-central /v/com. avast/scala-server-toolkit-pureconfig_2.13 )
13
13
14
- ` libraryDependencies += "com.avast.server.toolkit " %% "scala-server-toolkit-pureconfig" % "<VERSION>" `
14
+ ` libraryDependencies += "com.avast" %% "scala-server-toolkit-pureconfig" % "<VERSION>" `
Original file line number Diff line number Diff line change 1
1
# Module PureConfig
2
2
3
- ![ GitHub tag (latest SemVer) ] ( https://img.shields.io/github /v/tag/ avast/scala-server-toolkit?label=version&sort=semver )
3
+ ![ Maven Central ] ( https://img.shields.io/maven-central /v/com. avast/scala-server-toolkit-pureconfig_2.13 )
4
4
5
- ` libraryDependencies += "com.avast.server.toolkit " %% "scala-server-toolkit-pureconfig" % "<VERSION>" `
5
+ ` libraryDependencies += "com.avast" %% "scala-server-toolkit-pureconfig" % "<VERSION>" `
6
6
7
7
This module allows you to load your application's configuration file according to a case class provided to it. It uses
8
8
[ PureConfig] ( https://pureconfig.github.io ) library to do so which uses [ Lightbend Config] ( https://github.com/lightbend/config ) which means
9
9
that your application's configuration will be in [ HOCON] ( https://github.com/lightbend/config/blob/master/HOCON.md ) format.
10
10
11
+ Loading of configuration is side-effectful so it is wrapped in ` F ` which is ` Sync ` . This module also tweaks the error messages a little.
11
12
12
13
``` scala
13
14
import com .avast .server .toolkit .pureconfig ._
@@ -19,9 +20,9 @@ import zio.Task
19
20
final case class ServerConfiguration (listenAddress : String , listenPort : Int )
20
21
21
22
implicit val serverConfigurationReader : ConfigReader [ServerConfiguration ] = deriveReader
22
- // serverConfigurationReader: ConfigReader[ServerConfiguration] = pureconfig.generic.DerivedConfigReader1$$anon$3@662e5590
23
+ // serverConfigurationReader: ConfigReader[ServerConfiguration] = pureconfig.generic.DerivedConfigReader1$$anon$3@7d4e424e
23
24
24
25
val maybeConfiguration = PureConfigModule .make[Task , ServerConfiguration ]
25
- // maybeConfiguration: Task[Either[cats.data.NonEmptyList[String], ServerConfiguration]] = zio.ZIO$EffectPartial@606f0f70
26
+ // maybeConfiguration: Task[Either[cats.data.NonEmptyList[String], ServerConfiguration]] = zio.ZIO$EffectPartial@e2498a3
26
27
```
27
28
You can’t perform that action at this time.
0 commit comments