(ctx *InvokeContext, funcError, payload string, logMessage []string)
| 477 | } |
| 478 | |
| 479 | func build(ctx *InvokeContext, funcError, payload string, logMessage []string) (status int) { |
| 480 | status = http.StatusOK |
| 481 | if len(funcError) > 0 { |
| 482 | status = http.StatusInternalServerError |
| 483 | ctx.Response.SetHeader(api.XBceFunctionError, funcError) |
| 484 | } |
| 485 | |
| 486 | if logMessage != nil && len(logMessage) > 0 { |
| 487 | logResult := base64.StdEncoding.EncodeToString([]byte(strings.Join(logMessage, ""))) |
| 488 | ctx.Response.SetHeader(api.HeaderLogResult, logResult) |
| 489 | } |
| 490 | |
| 491 | ctx.Response.SetBody([]byte(payload)) |
| 492 | return |
| 493 | } |
| 494 | |
| 495 | func getFuncResult(output *rtctrl.InvocationResponse) string { |
| 496 | // FuncError |
no test coverage detected