MCPcopy Index your code
hub / github.com/cli/cli / CreateInvoker

Function CreateInvoker

internal/codespaces/rpc/invoker.go:63–73  ·  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

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