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

Function NewRuntimeClient

pkg/controller/rtctrl/client.go:42–55  ·  view source on GitHub ↗
(c *RuntimeConfigOptions, s *DispatcherV2Options, rtMap RuntimeDispatcher)

Source from the content-addressed store, hash-verified

40}
41
42func NewRuntimeClient(c *RuntimeConfigOptions, s *DispatcherV2Options, rtMap RuntimeDispatcher) (rc *RuntimeClient, err error) {
43 dispatchServer := NewDispatchServerV2(s, rtMap)
44 dispatchServer.ListenAndServe()
45 lt := UserLogType(s.UserLogType)
46 if !lt.Valid() {
47 err = fmt.Errorf("log type [%s] is invalid, should be plain or json", lt)
48 return nil, err
49 }
50 return &RuntimeClient{
51 dispatchServer: dispatchServer,
52 config: c,
53 userlogType: lt,
54 }, nil
55}
56
57func (s *RuntimeClient) createRequest(input *InvocationInput) *RequestInfo {
58 logs.V(5).Info("recv request.", zap.String("runtimeID", input.Runtime.RuntimeID))

Callers 3

InitFunction · 0.92
TestInvocationFunction · 0.85
TestInvocationWithStreamFunction · 0.85

Calls 5

ListenAndServeMethod · 0.95
NewDispatchServerV2Function · 0.85
UserLogTypeTypeAlias · 0.85
ErrorfMethod · 0.80
ValidMethod · 0.45

Tested by 2

TestInvocationFunction · 0.68
TestInvocationWithStreamFunction · 0.68