(ctx *InvokeContext, funcError, payload string, logMessage []string)
| 461 | } |
| 462 | |
| 463 | func buildTotallyToBody(ctx *InvokeContext, funcError, payload string, logMessage []string) (status int) { |
| 464 | status = http.StatusOK |
| 465 | result := logToBodyResult{ |
| 466 | FuncError: funcError, |
| 467 | LogResult: strings.Join(logMessage, ""), |
| 468 | Payload: payload, |
| 469 | } |
| 470 | if len(funcError) != 0 { |
| 471 | status = http.StatusInternalServerError |
| 472 | } |
| 473 | bodyData, _ := json.Marshal(result) |
| 474 | ctx.Response.SetHeader("Content-Type", "application/json; charset=utf-8") |
| 475 | ctx.Response.SetBody(bodyData) |
| 476 | return |
| 477 | } |
| 478 | |
| 479 | func build(ctx *InvokeContext, funcError, payload string, logMessage []string) (status int) { |
| 480 | status = http.StatusOK |
no test coverage detected