MCPcopy Index your code
hub / github.com/coder/coder / NewAgentConn

Function NewAgentConn

codersdk/workspacesdk/agentconn.go:40–45  ·  view source on GitHub ↗

NewAgentConn creates a new WorkspaceAgentConn. `conn` may be unique to the WorkspaceAgentConn, or it may be shared in the case of coderd. If the conn is shared and closing it is undesirable, you may return ErrNoClose from opts.CloseFunc. This will ensure the underlying conn is not closed.

(conn *tailnet.Conn, opts AgentConnOptions)

Source from the content-addressed store, hash-verified

38// conn is shared and closing it is undesirable, you may return ErrNoClose from
39// opts.CloseFunc. This will ensure the underlying conn is not closed.
40func NewAgentConn(conn *tailnet.Conn, opts AgentConnOptions) AgentConn {
41 return &agentConn{
42 Conn: conn,
43 opts: opts,
44 }
45}
46
47// WrapAgentConn returns an AgentConn that delegates every operation to conn and
48// applies closeFunc exactly once when the logical session is closed.

Callers 6

AgentConnMethod · 0.92
TestAgent_UpdatedDERPFunction · 0.92
setupAgentWithSecretsFunction · 0.92
DialAgentMethod · 0.85

Calls

no outgoing calls