MCPcopy
hub / github.com/cli/cli / CreateInvoker

Function CreateInvoker

internal/codespaces/rpc/invoker.go:64–74  ·  view source on GitHub ↗

Connects to the internal RPC server and returns a new invoker for it

(ctx context.Context, fwd portforwarder.PortForwarder)

Source from the content-addressed store, hash-verified

62
63// Connects to the internal RPC server and returns a new invoker for it
64func CreateInvoker(ctx context.Context, fwd portforwarder.PortForwarder) (Invoker, error) {
65 ctx, cancel := context.WithTimeout(ctx, ConnectionTimeout)
66 defer cancel()
67
68 invoker, err := connect(ctx, fwd)
69 if err != nil {
70 return nil, fmt.Errorf("error connecting to internal server: %w", err)
71 }
72
73 return invoker, nil
74}
75
76// Finds a free port to listen on and creates a new RPC invoker that connects to that port
77func connect(ctx context.Context, fwd portforwarder.PortForwarder) (Invoker, error) {

Callers 7

LogsMethod · 0.92
RebuildMethod · 0.92
SSHMethod · 0.92
printOpenSSHConfigMethod · 0.92
JupyterMethod · 0.92
PollPostCreateStatesFunction · 0.92
createTestInvokerFunction · 0.85

Calls 2

connectFunction · 0.85
ErrorfMethod · 0.65

Tested by 1

createTestInvokerFunction · 0.68