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

Function NewControllerClient

pkg/controller/client/rpc.go:39–52  ·  view source on GitHub ↗
(runOptions *ControllerClientOptions)

Source from the content-addressed store, hash-verified

37}
38
39func NewControllerClient(runOptions *ControllerClientOptions) (c *ControllerClient, err error) {
40 u, err := url.Parse(runOptions.Host)
41 if err != nil {
42 return nil, InvaildConfigError{Reason: fmt.Sprintf("invaild host %s", runOptions.Host)}
43 }
44 client := rest.NewFastClient(u.Host)
45 return &ControllerClient{
46 client: client,
47 scheme: u.Scheme,
48 prefix: u.Path,
49 version: "v1",
50 host: u.Host,
51 }, nil
52}
53
54func (c *ControllerClient) Invoke(ir *api.InvokeRequest) (response *api.InvokeResponse, err error) {
55 response = api.NewInvokeResponse()

Callers 3

InitFunction · 0.92
TestNewControllerClientFunction · 0.85
TestInvokeFunction · 0.85

Calls 1

NewFastClientFunction · 0.92

Tested by 2

TestNewControllerClientFunction · 0.68
TestInvokeFunction · 0.68