| 2158 | } |
| 2159 | |
| 2160 | type API struct { |
| 2161 | // ctx is canceled immediately on shutdown, it can be used to abort |
| 2162 | // interruptible tasks. |
| 2163 | ctx context.Context |
| 2164 | cancel context.CancelFunc |
| 2165 | |
| 2166 | // DeploymentID is loaded from the database on startup. |
| 2167 | DeploymentID string |
| 2168 | |
| 2169 | *Options |
| 2170 | // ID is a uniquely generated ID on initialization. |
| 2171 | // This is used to associate objects with a specific |
| 2172 | // Coder API instance, like workspace agents to a |
| 2173 | // specific replica. |
| 2174 | ID uuid.UUID |
| 2175 | Auditor atomic.Pointer[audit.Auditor] |
| 2176 | ConnectionLogger atomic.Pointer[connectionlog.ConnectionLogger] |
| 2177 | WorkspaceClientCoordinateOverride atomic.Pointer[func(rw http.ResponseWriter) bool] |
| 2178 | TailnetCoordinator atomic.Pointer[tailnet.Coordinator] |
| 2179 | NetworkTelemetryBatcher *tailnet.NetworkTelemetryBatcher |
| 2180 | TailnetClientService *tailnet.ClientService |
| 2181 | // WebpushDispatcher is a way to send notifications to users via Web Push. |
| 2182 | WebpushDispatcher webpush.Dispatcher |
| 2183 | QuotaCommitter atomic.Pointer[proto.QuotaCommitter] |
| 2184 | AppearanceFetcher atomic.Pointer[appearance.Fetcher] |
| 2185 | // WorkspaceProxyHostsFn returns the hosts of healthy workspace proxies |
| 2186 | // for header reasons. |
| 2187 | WorkspaceProxyHostsFn atomic.Pointer[func() []*proxyhealth.ProxyHost] |
| 2188 | // TemplateScheduleStore is a pointer to an atomic pointer because this is |
| 2189 | // passed to another struct, and we want them all to be the same reference. |
| 2190 | TemplateScheduleStore *atomic.Pointer[schedule.TemplateScheduleStore] |
| 2191 | // UserQuietHoursScheduleStore is a pointer to an atomic pointer for the |
| 2192 | // same reason as TemplateScheduleStore. |
| 2193 | UserQuietHoursScheduleStore *atomic.Pointer[schedule.UserQuietHoursScheduleStore] |
| 2194 | // DERPMapper mutates the DERPMap to include workspace proxies. |
| 2195 | DERPMapper atomic.Pointer[func(derpMap *tailcfg.DERPMap) *tailcfg.DERPMap] |
| 2196 | // AccessControlStore is a pointer to an atomic pointer since it is |
| 2197 | // passed to dbauthz. |
| 2198 | AccessControlStore *atomic.Pointer[dbauthz.AccessControlStore] |
| 2199 | PortSharer atomic.Pointer[portsharing.PortSharer] |
| 2200 | FileCache *files.Cache |
| 2201 | PrebuildsClaimer atomic.Pointer[prebuilds.Claimer] |
| 2202 | PrebuildsReconciler atomic.Pointer[prebuilds.ReconciliationOrchestrator] |
| 2203 | // BuildUsageChecker is a pointer as it's passed around to multiple |
| 2204 | // components. |
| 2205 | BuildUsageChecker *atomic.Pointer[wsbuilder.UsageChecker] |
| 2206 | // UsageInserter is a pointer to an atomic pointer because it is passed to |
| 2207 | // multiple components. |
| 2208 | UsageInserter *atomic.Pointer[usage.Inserter] |
| 2209 | // AIBridgeTransportFactory, when non-nil, lets chatd route LLM requests |
| 2210 | // through an in-process aibridge transport instead of calling upstream |
| 2211 | // providers directly. Registered by coderd at startup once aibridged is |
| 2212 | // wired in-memory. |
| 2213 | AIBridgeTransportFactory atomic.Pointer[aibridge.TransportFactory] |
| 2214 | // aibridgedHandler is the in-memory aibridge HTTP handler. Set by |
| 2215 | // RegisterInMemoryAIBridgedHTTPHandler; read both by the enterprise |
| 2216 | // /api/v2/aibridge route (license-gated) and by the in-memory transport |
| 2217 | // (used by chatd, license-exempt). |
nothing calls this directly
no outgoing calls
no test coverage detected