package
Version:
v0.5.1
Opens a new window with list of versions in this module.
Published: Dec 13, 2022
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 9
Opens a new window with list of known importers.
README
¶
json
The json package provides a config
Decoder that unmarshals values from JSON formatted sources.
Example usage:
import (
"fmt"
"github.com/warthog618/config"
"github.com/warthog618/config/blob"
"github.com/warthog618/config/blob/decoder/json"
"github.com/warthog618/config/blob/loader/file"
)
func main() {
c := config.New(blob.New(file.New("config.json"), json.NewDecoder()))
s := c.MustGet("nested.string").String()
fmt.Println("s:", s)
// ....
}
Documentation
¶
Package json provides a JSON format decoder for config.
Decoder provides the Decoder API required by config.Source.
NewDecoder returns a JSON decoder.
Decode unmarshals an array of bytes containing JSON text.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.