MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / normalizedConfigNode

Function normalizedConfigNode

internal/pluginhost/config.go:153–164  ·  view source on GitHub ↗
(item config.PluginInstanceConfig, enabled bool)

Source from the content-addressed store, hash-verified

151}
152
153func normalizedConfigNode(item config.PluginInstanceConfig, enabled bool) *yaml.Node {
154 if item.Raw.Kind == 0 {
155 return defaultRuntimeConfigNode(enabled, item.Priority)
156 }
157 node := deepCopyYAMLNode(&item.Raw)
158 if node.Kind != yaml.MappingNode {
159 return node
160 }
161 ensureMappingScalar(node, "enabled", boolYAMLValue(enabled), "!!bool")
162 ensureMappingScalar(node, "priority", intYAMLValue(item.Priority), "!!int")
163 return node
164}
165
166func defaultRuntimeConfigNode(enabled bool, priority int) *yaml.Node {
167 return &yaml.Node{

Callers 1

runtimeConfigYAMLFunction · 0.85

Calls 5

defaultRuntimeConfigNodeFunction · 0.85
ensureMappingScalarFunction · 0.85
boolYAMLValueFunction · 0.85
intYAMLValueFunction · 0.85
deepCopyYAMLNodeFunction · 0.70

Tested by

no test coverage detected