knobs
package knobs
- Alphabetic
- By Inheritance
- knobs
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
BaseConfig[F[_]](paths: Ref[F, List[(Name, KnobsResource)]], cfgMap: Ref[F, Env], subs: Ref[F, Map[Pattern, List[ChangeHandler[F]]]]) extends Product with Serializable
Global configuration data.
Global configuration data. This is the top-level config from which
Config
values are derived by choosing a root location. - final case class Bind(name: Name, value: CfgValue) extends Directive with Product with Serializable
- final case class CfgBool(value: Boolean) extends CfgValue with Product with Serializable
- final case class CfgDuration(value: Duration) extends CfgValue with Product with Serializable
- final case class CfgList(value: List[CfgValue]) extends CfgValue with Product with Serializable
- final case class CfgNumber(value: Double) extends CfgValue with Product with Serializable
- final case class CfgText(value: String) extends CfgValue with Product with Serializable
-
sealed abstract
class
CfgValue extends Product with Serializable
A bound configuration value
-
type
ChangeHandler[F[_]] = (Name, Option[CfgValue]) ⇒ F[Unit]
A change handler takes the
Name
of the property that changed, the value of that property (orNone
if the property was removed), and produces aIO
to perform in reaction to that change. -
case class
Config(env: Env) extends Product with Serializable
Immutable configuration data
-
final
case class
ConfigError[R](path: R, err: String)(implicit evidence$1: Resource[R]) extends Exception with Product with Serializable
An error during parsing of a configuration file
-
trait
Configured[A] extends AnyRef
The class of types that can be automatically and safely converted from a
CfgValue
to a destination type.The class of types that can be automatically and safely converted from a
CfgValue
to a destination type. If conversion fails because the types are not compatible,None
is returned. -
sealed abstract
class
Directive extends Product with Serializable
A directive in a configuration file
-
type
Env = Map[Name, CfgValue]
A pure configuration environment map, detached from its sources
-
final
case class
Exact(name: Name) extends Pattern with Product with Serializable
An exact match
- final case class Group(name: Name, directives: List[Directive]) extends Directive with Product with Serializable
- final case class Import(path: Path) extends Directive with Product with Serializable
- final case class Interpolate(text: String) extends Interpolation with Product with Serializable
- sealed abstract class Interpolation extends Product with Serializable
- final case class KeyError(name: String) extends Exception with Product with Serializable
-
type
KnobsResource = Worth[ResourceBox]
exists r.
exists r. Resource r ⇒ Required r | Optional r
- final case class Literal(text: String) extends Interpolation with Product with Serializable
-
case class
MutableConfig[F[_]](root: String, base: BaseConfig[F]) extends Product with Serializable
Mutable, reloadable, configuration data
-
type
Name = String
The name of a configuration property
- final case class Optional[A](worth: A) extends Worth[A] with Product with Serializable
-
final
case class
ParseException(msg: String) extends RuntimeException with Product with Serializable
A small exception modeling class used by
Config.parse
if the parsing failed. -
type
Path = String
A path-like string
-
sealed abstract
class
Pattern extends Product with Serializable
A pattern that matches a
Name
either exactly or as a prefix. -
final
case class
Prefix(name: Name) extends Pattern with Product with Serializable
A prefix match.
A prefix match. Given
Prefix("foo")
, this will match"foo.bar"
, but not"foo"
or"foobar"
. - final case class Required[A](worth: A) extends Worth[A] with Product with Serializable
-
trait
Resource[R] extends Show[R]
Resources from which configuration files can be loaded
-
sealed
trait
ResourceBox extends AnyRef
An existential resource.
An existential resource. Equivalent to the (Haskell-style) type
exists r. Resource r ⇒ r
- sealed trait Trivial extends AnyRef
- sealed abstract class Valuable[V] extends AnyRef
- final case class ValueError(name: String, value: CfgValue) extends Exception with Product with Serializable
- trait Watchable[R] extends Resource[R]
-
sealed abstract
class
Worth[A] extends Product with Serializable
A value that is either required or optional.
Value Members
-
def
load[F[_]](files: List[KnobsResource], pool: ExecutionContext = Resource.notificationPool)(implicit arg0: Effect[F]): F[MutableConfig[F]]
Create a
MutableConfig
from the contents of the given resources.Create a
MutableConfig
from the contents of the given resources. Throws an exception on error, such as if files do not exist or contain errors.File names have any environment variables expanded prior to the first time they are opened, so you can specify a file name such as
"$(HOME)/myapp.cfg"
. -
def
loadGroups[F[_]](files: List[(Name, KnobsResource)], pool: ExecutionContext = Resource.notificationPool)(implicit arg0: Effect[F]): F[MutableConfig[F]]
Create a
MutableConfig
from the contents of the named files, placing them into named prefixes. -
def
loadImmutable[F[_]](files: List[KnobsResource], pool: ExecutionContext = Resource.notificationPool)(implicit arg0: Effect[F]): F[Config]
Create an immutable
Config
from the contents of the named files.Create an immutable
Config
from the contents of the named files. Throws an exception on error, such as if files do not exist or contain errors.File names have any environment variables expanded prior to the first time they are opened, so you can specify a file name such as
"$(HOME)/myapp.cfg"
. -
def
recursiveImports[F[_], R](path: R, d: List[Directive])(implicit arg0: Sync[F], arg1: Resource[R]): F[List[R]]
Get all the imports in the given list of directive, recursively resolving imports relative to the given path by loading them.
- object ClassPathResource
- object Config extends Serializable
- object ConfigParser
- object Configured
- object FileResource
- object Pattern extends Serializable
- object Resource extends Serializable
- object ResourceBox
- object SysPropsResource
- object Trivial
- object URIResource
- object Valuable
- object Watched
- object Worth extends Serializable
-
object
aws
Reads a set of configuration information from the running machine within the AWS environment.
Reads a set of configuration information from the running machine within the AWS environment. Amazon documentaiton can be found here:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
Deprecated Value Members
-
def
importsOf[R](path: R, d: List[Directive])(implicit arg0: Resource[R]): List[KnobsResource]
Get all the imports in the given list of directives, relative to the given path
Get all the imports in the given list of directives, relative to the given path
- Annotations
- @deprecated
- Deprecated
(Since version 4.0.31) Does not support interpolation of environment variables
-
def
resolveImports[R](path: R, d: List[Directive])(implicit arg0: Resource[R]): List[R]
Get all the imports in the given list of directives, relative to the given path
Get all the imports in the given list of directives, relative to the given path
- Annotations
- @deprecated
- Deprecated
(Since version 4.0.31) Does not support interpolation of environment variables