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

Struct BasicCoordinationController

tailnet/controllers.go:153–168  ·  view source on GitHub ↗

BasicCoordinationController handles the basic coordination operations common to all types of tailnet consumers: 1. sending local node updates to the Coordinator 2. receiving peer node updates and programming them into the Coordinatee (e.g. tailnet.Conn) 3. (optionally) sending ReadyToHandshake ackn

Source from the content-addressed store, hash-verified

151//
152// It is designed to be used on its own, or composed into more advanced CoordinationControllers.
153type BasicCoordinationController struct {
154 Logger slog.Logger
155 Coordinatee Coordinatee
156 SendAcks bool
157 // Initiator labels which side of the coordination this controller
158 // represents (e.g. "agent", "client", "server"). It is attached as
159 // a slog field to disconnect-related logs emitted by this
160 // coordination so operators can attribute connection-close events
161 // without inspecting call sites. Leave unset on synthetic
162 // controllers (tests, in-memory fakes) and the field will be
163 // omitted from log output.
164 Initiator codersdk.DisconnectInitiator
165 // Direction labels the connection layer (server_to_agent,
166 // agent_to_client, client_to_server) for disconnect logs.
167 Direction codersdk.ConnectionDirection
168}
169
170// New satisfies the method on the CoordinationController interface
171func (c *BasicCoordinationController) New(client CoordinatorClient) CloserWaiter {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected