object YamlConfigSource
- Annotations
- @silent( "Unused import" )
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- YamlConfigSource
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
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[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromYamlFile(file: File): config.ConfigSource
Retrieve a
ConfigSourcefrom yaml path.Retrieve a
ConfigSourcefrom yaml path.A complete example usage:
case class MyConfig(port: Int, url: String) val result: Either[ReadError[String], MyConfig] = YamlConfigSource.fromYamlFile(new File("/path/to/file.yaml")) .flatMap(source => read(descriptor[MyConfig] from source)))
-
def
fromYamlPath(path: Path): config.ConfigSource
Retrieve a
ConfigSourcefrom yaml path.Retrieve a
ConfigSourcefrom yaml path.A complete example usage:
case class MyConfig(port: Int, url: String) val result: Either[ReadError[String], MyConfig] = YamlConfigSource.fromYamlPath(Path.of("/path/to/file.yaml")) .flatMap(source => read(descriptor[MyConfig] from source)))
-
def
fromYamlReader(reader: Reader, sourceName: String = "yaml"): config.ConfigSource
Retrieve a
ConfigSourcefrom yaml reader.Retrieve a
ConfigSourcefrom yaml reader.A complete example usage:
import zio.* import scala.io.Source import java.io.InputStreamReader import zio.config.yaml.YamlConfigSource case class MyConfig(port: Int, url: String) def acquire(yamlResourcePath: String) = ZIO.effect(Source.fromResource(yamlResourcePath).reader) def release(reader: InputStreamReader) = ZIO.effectTotal(reader.close()) val myConfig: InputStreamReader => IO[ReadError[String], MyConfig] = reader => IO.fromEither( for { source <- YamlConfigSource.fromYamlReader(reader) myConfig <- read(descriptor[MyConfig] from source) } yield myConfig ) val result: Task[MyConfig] = ZManaged.make(acquire("relative/path/to/your/application/resource.yml"))(release).use(myConfig)
-
def
fromYamlString(yamlString: String, sourceName: String = "yaml"): config.ConfigSource
Retrieve a
ConfigSourcefrom yaml path.Retrieve a
ConfigSourcefrom yaml path.A complete example usage:
val yamlString = ??? case class MyConfig(port: Int, url: String) val result: Either[ReadError[String], MyConfig] = YamlConfigSource.fromYamlString(yamlString)) .flatMap(source => read(descriptor[MyConfig] from source)))
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()