MCPcopy Index your code
hub / github.com/docker/docker-agent / parseConfigJS

Function parseConfigJS

cmd/wasm/main.go:112–124  ·  view source on GitHub ↗

--------------------------------------------------------------------------- parseConfig ---------------------------------------------------------------------------

(_ js.Value, args []js.Value)

Source from the content-addressed store, hash-verified

110// ---------------------------------------------------------------------------
111
112func parseConfigJS(_ js.Value, args []js.Value) any {
113 if len(args) < 1 {
114 return throwingError("parseConfig: expected yaml string argument")
115 }
116 yamlStr := args[0].String()
117
118 cfg, err := config.Load(context.Background(), config.NewBytesSource("config.yaml", []byte(yamlStr)))
119 if err != nil {
120 return throwingError(fmt.Sprintf("parseConfig: %v", err))
121 }
122
123 return js.ValueOf(configToMap(cfg))
124}
125
126// ---------------------------------------------------------------------------
127// listAgents

Callers

nothing calls this directly

Calls 5

LoadFunction · 0.92
NewBytesSourceFunction · 0.92
throwingErrorFunction · 0.85
configToMapFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected