MCPcopy Create free account
hub / github.com/eth-easl/dirigent / GetProxyServer

Method GetProxyServer

internal/data_plane/data_plane.go:159–194  ·  view source on GitHub ↗
(async bool)

Source from the content-addressed store, hash-verified

157}
158
159func (d *Dataplane) GetProxyServer(async bool) (proxy.Proxy, error) {
160 cpApi, err := grpc_helpers.NewControlPlaneConnection(d.config.ControlPlaneAddress)
161 if err != nil {
162 return nil, err
163 }
164
165 err = d.registerDataPlane(cpApi)
166 if err != nil {
167 return nil, err
168 }
169
170 err = d.syncDeploymentCache(&cpApi, d.deployments)
171 if err != nil {
172 return nil, err
173 }
174
175 loadBalancingPolicy := d.parseLoadBalancingPolicy(d.config)
176
177 if !async {
178 return proxy.NewProxyingService(
179 d.config.PortProxy,
180 d.deployments,
181 cpApi,
182 path.Join(d.config.TraceOutputFolder, "proxy_trace.csv"),
183 loadBalancingPolicy,
184 ), nil
185 } else {
186 return proxy.NewAsyncProxyingService(
187 d.config,
188 d.deployments,
189 cpApi,
190 path.Join(d.config.TraceOutputFolder, "proxy_trace.csv"),
191 loadBalancingPolicy,
192 ), nil
193 }
194}
195
196func (d *Dataplane) DeregisterControlPlaneConnection() {
197 err := grpc_helpers.DeregisterControlPlaneConnection(&d.config)

Callers 1

mainFunction · 0.95

Calls 6

registerDataPlaneMethod · 0.95
syncDeploymentCacheMethod · 0.95
NewProxyingServiceFunction · 0.92
NewAsyncProxyingServiceFunction · 0.92

Tested by

no test coverage detected