MCPcopy
hub / github.com/docker/docker-agent / setupFakeProxy

Function setupFakeProxy

cmd/root/record.go:12–23  ·  view source on GitHub ↗

setupFakeProxy starts a fake proxy if fakeResponses is non-empty. It configures the runtime config's ModelsGateway to point to the proxy.

(ctx context.Context, fakeResponses string, streamDelayMs int, runConfig *config.RuntimeConfig)

Source from the content-addressed store, hash-verified

10// setupFakeProxy starts a fake proxy if fakeResponses is non-empty.
11// It configures the runtime config's ModelsGateway to point to the proxy.
12func setupFakeProxy(ctx context.Context, fakeResponses string, streamDelayMs int, runConfig *config.RuntimeConfig) (cleanup func() error, err error) {
13 proxyURL, cleanupFn, err := recording.SetupFakeProxy(ctx, fakeResponses, streamDelayMs)
14 if err != nil {
15 return nil, err
16 }
17
18 if proxyURL != "" {
19 runConfig.ModelsGateway = proxyURL
20 }
21
22 return cleanupFn, nil
23}
24
25// setupRecordingProxy starts a recording proxy if recordPath is non-empty.
26// It configures the runtime config's ModelsGateway to point to the proxy.

Callers 2

runAPICommandMethod · 0.85
runOrExecMethod · 0.85

Calls 1

SetupFakeProxyFunction · 0.92

Tested by

no test coverage detected