# README
blob
A library for loading configuration files into config.
Blobs represent configuration sources containing configuration stored as a block and in a known format, e.g. config files. Blobs are partitioned into two layers, the Loader, which loads the configuration as a []byte blob from the source, and the Decoder, which decodes the blob into a form that can be used by config.
The Loader may support being watched for changes, and if so the Blob containing it will automatically support being watched for changes as well.
Quick Start
Given a loader and decoder, you create a blob and add it to your config:
c := config.New(blob.New(file.New("config.json"), json.NewDecoder()))
or add it into your config stack:
c := config.New(pflag.New(), env.New())
// ...
cfgFile := blob.New(file.New("config.json"), json.NewDecoder())
c.Append(cfgFile)
Loaders
Loaders read configuration from some source.
The following loaders are provided:
Loader | Configuration Source |
---|---|
bytes | []byte |
file | local file |
Decoders
Decoders unmarshal configuration from a particular textual format.
Decoders for the following formats are provided: