knobs
package knobs
- Alphabetic
- By Inheritance
- knobs
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
BaseConfig
(paths: IORef[List[(Name, KnobsResource)]], cfgMap: IORef[Env], subs: IORef[Map[Pattern, List[ChangeHandler]]]) 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. - case class Bind (name: Name, value: CfgValue) extends Directive with Product with Serializable
- case class CfgBool (value: Boolean) extends CfgValue with Product with Serializable
- case class CfgDuration (value: Duration) extends CfgValue with Product with Serializable
- case class CfgList (value: List[CfgValue]) extends CfgValue with Product with Serializable
- case class CfgNumber (value: Double) extends CfgValue with Product with Serializable
- case class CfgText (value: String) extends CfgValue with Product with Serializable
-
sealed
trait
CfgValue
extends AnyRef
A bound configuration value
-
type
ChangeHandler = (Name, Option[CfgValue]) ⇒ Task[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 aTask
to perform in reaction to that change. -
case class
Config
(env: Env) extends Product with Serializable
Immutable configuration data
-
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
trait
Directive
extends AnyRef
A directive in a configuration file
-
type
Env = Map[Name, CfgValue]
A pure configuration environment map, detached from its sources
-
case class
Exact
(name: Name) extends Pattern with Product with Serializable
An exact match
- case class Group (name: Name, directives: List[Directive]) extends Directive with Product with Serializable
-
sealed abstract
class
IORef
[A] extends AnyRef
An atomically updatable reference, guarded by the
Task
monad. - case class Import (path: Path) extends Directive with Product with Serializable
- case class Interpolate (text: String) extends Interpolation with Product with Serializable
- sealed trait Interpolation extends AnyRef
- 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
- case class Literal (text: String) extends Interpolation with Product with Serializable
-
case class
MutableConfig
(root: String, base: BaseConfig) extends Product with Serializable
Mutable, reloadable, configuration data
-
type
Name = String
The name of a configuration property
- case class Optional [A](worth: A) extends Worth[A] with Product with Serializable
-
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
trait
Pattern
extends AnyRef
A pattern that matches a
Name
either exactly or as a prefix. -
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"
. - 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 trait Valuable [V] extends AnyRef
- case class ValueError (name: String, value: CfgValue) extends Exception with Product with Serializable
- trait Watchable [R] extends Resource[R]
-
sealed
trait
Worth
[A] extends AnyRef
A value that is either required or optional.
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
-
def
load(files: List[KnobsResource], pool: ExecutorService = Resource.notificationPool): Task[MutableConfig]
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(files: List[(Name, KnobsResource)], pool: ExecutorService = Resource.notificationPool): Task[MutableConfig]
Create a
MutableConfig
from the contents of the named files, placing them into named prefixes. -
def
loadImmutable(files: List[KnobsResource], pool: ExecutorService = Resource.notificationPool): Task[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[R](path: R, d: List[Directive])(implicit arg0: Resource[R]): Task[List[R]]
Get all the imports in the given list of directive, recursively resolving imports relative to the given path by loading them.
-
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
- def when[M[_]](b: Boolean)(m: M[Unit])(implicit arg0: Monad[M]): M[Unit]
- object ClassPathResource
- object Config extends Serializable
- object ConfigParser
- object Configured
- object FileResource
- object IORef
- object Pattern
- object Resource
- object ResourceBox
- object SysPropsResource
- object Trivial
- object URIResource
- object Valuable
- object Watched
- object Worth
-
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
- object compatibility