|
|
@@ -16,10 +16,21 @@ type ConfigerChannelYAML struct { |
|
|
|
|
|
|
|
func (conf *ConfigerChannelYAML) String(item string) string { |
|
|
|
chunks := strings.SplitN(item, ".", 2) |
|
|
|
target := recursiveParse(chunks[1], conf.tmp) |
|
|
|
var target interface{} |
|
|
|
if len(chunks) > 1 { |
|
|
|
target = recursiveParse(chunks[1], conf.tmp) |
|
|
|
} else { |
|
|
|
target = conf.tmp |
|
|
|
} |
|
|
|
|
|
|
|
if str, ok := target.(string); ok { |
|
|
|
return str |
|
|
|
} else { |
|
|
|
if out, err := yaml.Marshal(target); err == nil { |
|
|
|
return bytes.NewBuffer(out).String() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|