MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / build

Function build

pkg/controller/invoke.go:479–493  ·  view source on GitHub ↗
(ctx *InvokeContext, funcError, payload string, logMessage []string)

Source from the content-addressed store, hash-verified

477}
478
479func 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
495func getFuncResult(output *rtctrl.InvocationResponse) string {
496 // FuncError

Callers 1

buildResponseMethod · 0.85

Calls 2

SetHeaderMethod · 0.45
SetBodyMethod · 0.45

Tested by

no test coverage detected