Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parser ¶
Parser is a conf.ParseFunc to parse the given json
Example ¶
package main import ( "context" "fmt" "strings" "github.com/sv-tools/conf" confjson "github.com/sv-tools/conf-parser-json" ) func main() { data := strings.NewReader(`{"foo": 42, "bar": "test"}`) c := conf.New().WithReaders(conf.NewStreamParser(data).WithParser(confjson.Parser)) if err := c.Load(context.Background()); err != nil { panic(err) } fmt.Println(c.GetInt("foo")) }
Output: 42
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.