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

Method makeInvokeRequest

pkg/controller/rtctrl/client.go:82–102  ·  view source on GitHub ↗
(input *InvocationInput)

Source from the content-addressed store, hash-verified

80}
81
82func (s *RuntimeClient) makeInvokeRequest(input *InvocationInput) *InvokeRequest {
83 invokeReq := &InvokeRequest{
84 RequestID: input.RequestID,
85 Version: *input.Configuration.Version,
86 }
87
88 if input.InvokeType != api.InvokeTypeEvent && input.Request.BodyStream != nil {
89 bs, err := ioutil.ReadAll(input.Request.BodyStream)
90 if err != nil {
91 input.Logger.Errorf("read event body failed: %s", err)
92 } else {
93 invokeReq.EventObject = string(bs)
94 }
95 } else {
96 invokeReq.EventObject = string(input.Request.Body)
97 }
98 if invokeReq.EventObject == "" {
99 invokeReq.EventObject = "{}"
100 }
101 return invokeReq
102}
103
104func (s *RuntimeClient) makeInvokeHTTPRequest(reqInfo *RequestInfo, input *InvocationInput) *InvokeHTTPRequest {
105 req, cancel := ConvertProxyRequestToHTTP(reqInfo)

Callers 1

InvokeFuncMethod · 0.95

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected