(v *Visitor, ctx *parser.FunctionCallContext)
| 274 | } |
| 275 | |
| 276 | func JSONGet(v *Visitor, ctx *parser.FunctionCallContext) interface{} { |
| 277 | paramValues := v.buildParamValues(ctx) |
| 278 | p0 := paramValues[0] |
| 279 | p1 := paramValues[1] |
| 280 | var ( |
| 281 | v1, v2 string |
| 282 | ) |
| 283 | switch p0.(type) { |
| 284 | case *LeftValue: |
| 285 | value := p0.(*LeftValue).GetValue() |
| 286 | switch value.(type) { |
| 287 | case string: |
| 288 | v1 = fmt.Sprintf("%s", value) |
| 289 | default: |
| 290 | log.RuntimePanic(ctx, fmt.Sprintf("JSONGet JSON parameter are not a string: %v", reflect.TypeOf(value))) |
| 291 | } |
| 292 | case string: |
| 293 | v1 = fmt.Sprintf("%s", p0) |
| 294 | } |
| 295 | switch p1.(type) { |
| 296 | case *LeftValue: |
| 297 | value := p1.(*LeftValue).GetValue() |
| 298 | switch value.(type) { |
| 299 | case string: |
| 300 | v2 = fmt.Sprintf("%s", value) |
| 301 | default: |
| 302 | log.RuntimePanic(ctx, fmt.Sprintf("JSONGet path parameter are not a string: %v", reflect.TypeOf(value))) |
| 303 | } |
| 304 | case string: |
| 305 | v2 = fmt.Sprintf("%s", p1) |
| 306 | } |
| 307 | return xjson.Get(v1, v2).Raw() |
| 308 | |
| 309 | } |
| 310 | |
| 311 | func getCurrentTime(v *Visitor, ctx *parser.FunctionCallContext) interface{} { |
| 312 | tz, layout := v.getTzAndLayout(ctx) |
nothing calls this directly
no test coverage detected