mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-04 21:42:57 +02:00
add json.NewValues to config
This commit is contained in:
@ -21,6 +21,15 @@ type jsonValue struct {
|
||||
*simple.Json
|
||||
}
|
||||
|
||||
func NewValues(val []byte) (reader.Values, error) {
|
||||
sj := simple.New()
|
||||
data, _ := reader.ReplaceEnvVars(val)
|
||||
if err := sj.UnmarshalJSON(data); err != nil {
|
||||
sj.SetPath(nil, string(data))
|
||||
}
|
||||
return &jsonValues{sj: sj}, nil
|
||||
}
|
||||
|
||||
func newValues(ch *source.ChangeSet) (reader.Values, error) {
|
||||
sj := simple.New()
|
||||
data, _ := reader.ReplaceEnvVars(ch.Data)
|
||||
|
Reference in New Issue
Block a user