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
| 151 | // |
| 152 | // It is designed to be used on its own, or composed into more advanced CoordinationControllers. |
| 153 | type 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 |
| 171 | func (c *BasicCoordinationController) New(client CoordinatorClient) CloserWaiter { |
nothing calls this directly
no outgoing calls
no test coverage detected