MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / parseVariables

Function parseVariables

checks/http.go:187–196  ·  view source on GitHub ↗
(body []byte, vardefs []api.HTTPRequestResponseVariable, variables map[string]string)

Source from the content-addressed store, hash-verified

185}
186
187func parseVariables(body []byte, vardefs []api.HTTPRequestResponseVariable, variables map[string]string) error {
188 for _, vardef := range vardefs {
189 val, err := valFromJqPath(vardef.Path, string(body))
190 if err != nil {
191 return err
192 }
193 variables[vardef.Name] = fmt.Sprintf("%v", val)
194 }
195 return nil
196}
197
198func InterpolateVariables(template string, vars map[string]string) string {
199 r := regexp.MustCompile(`\$\{([^}]+)\}`)

Callers 1

runHTTPRequestFunction · 0.85

Calls 1

valFromJqPathFunction · 0.85

Tested by

no test coverage detected