ConfigSourceRecord

PackageAxial.Configuration
One named configuration layer. Reading is the effect; the result is plain Data.

Fields

NameTypeDescription
NameNameThe layer name shown in messages.
SpellSpellWrites a model path in this layer's own notation, for omission messages.
ReadReadReads the layer; source failures are typed and accumulated by Config.load.
PathsPathsFiles this layer reads, watched by Config.watch; empty for static layers.

Specification

Kind
Record
Members
8
Examples
0
environmentSignature
environment prefix
environmentOfSignature
environmentOf prefix pairs
commandLineSignature
commandLine arguments
jsonFileSignature
jsonFile path
optionalJsonFileSignature
optionalJsonFile path

Summary

NameSignatureSynopsis
Operations
environmentenvironment prefixReads the live process environment once, split by the __ convention, optionally under a prefix.
environmentOfenvironmentOf prefix pairsReads a fixed set of environment-style pairs; use it in tests and for host-supplied environments.
commandLinecommandLine argumentsReads command-line arguments, including nested --Db:Port, repeated values and positionals.
jsonFilejsonFile pathReads one JSON file through IHasFileSystem; a missing file is a source failure.
optionalJsonFileoptionalJsonFile pathReads one JSON file when it exists and an empty object when it does not.
jsonjson name textReads JSON text already in memory; a parse failure is a source failure.
queryStringqueryString searchReads a browser query string such as ?Db.Host=localhost&Db.Port=5432.
ofDataofData name dataReads structured data provided by the caller; use it for defaults, fixtures and fakes.

Operations

kind:member

environment

environment prefix
Member
Reads the live process environment once, split by the __ convention, optionally under a prefix.

Parameters

NameTypeDescription
prefixstring option

Returns

ConfigSource<'env>
kind:member

environmentOf

environmentOf prefix pairs
Member
Reads a fixed set of environment-style pairs; use it in tests and for host-supplied environments.

Parameters

NameTypeDescription
prefixstring option
pairs(string * string) seq

Returns

ConfigSource<'env>
kind:member

commandLine

commandLine arguments
Member
Reads command-line arguments, including nested --Db:Port, repeated values and positionals.

Parameters

NameTypeDescription
argumentsstring list

Returns

ConfigSource<'env>
kind:member

jsonFile

jsonFile path
Member
Reads one JSON file through IHasFileSystem; a missing file is a source failure.

Parameters

NameTypeDescription
pathstring

Returns

ConfigSource<'env>
kind:member

optionalJsonFile

optionalJsonFile path
Member
Reads one JSON file when it exists and an empty object when it does not.

Parameters

NameTypeDescription
pathstring

Returns

ConfigSource<'env>
kind:member

json

json name text
Member
Reads JSON text already in memory; a parse failure is a source failure.

Parameters

NameTypeDescription
namestring
textstring

Returns

ConfigSource<'env>
kind:member

queryString

queryString search
Member
Reads a browser query string such as ?Db.Host=localhost&Db.Port=5432.

Parameters

NameTypeDescription
searchstring

Returns

ConfigSource<'env>
kind:member

ofData

ofData name data
Member
Reads structured data provided by the caller; use it for defaults, fixtures and fakes.

Parameters

NameTypeDescription
namestring
dataData

Returns

ConfigSource<'env>