--------------------------------------------------------------------------- parseConfig ---------------------------------------------------------------------------
(_ js.Value, args []js.Value)
| 110 | // --------------------------------------------------------------------------- |
| 111 | |
| 112 | func 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 |
nothing calls this directly
no test coverage detected