This package is not in the latest version of its module.
Go to latest Published: Jul 14, 2026 License: AGPL-3.0The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Modules with tagged versions give importers more predictable builds.
When a project reaches major version v1 it is considered stable.
This section is empty.
AuthorizeFilter takes a list of objects and returns the filtered list of objects that the user is authorized to perform the given action on. This is faster than calling Authorize() on each object.
BackfillBedrockProviderType promotes legacy ai_providers rows stored as type=anthropic with Bedrock settings to type=bedrock. Must run after newAPI so options.Database is dbcrypt-wrapped. Idempotent; errors are logged and startup continues.
ChatProviderAPIKeysFromDeploymentValues returns deployment-backed chat provider API keys.
LatencyCheck is an endpoint for the web ui to measure latency with. allowAll allows any Origin to get timing information. The allowAll should only be set in dev modes.
ParsePagination extracts pagination query params from the http request. If an error is encountered, the error is written to w and ok is set to false.
nolint:revive
SeedAIProvidersFromEnv reconciles the deployment's environment- derived AI provider configuration with rows in the ai_providers table at server startup. Concurrent server starts are serialized via a Postgres advisory lock; rows that already exist with a matching canonical hash are left alone, missing rows are inserted, and rows whose hash differs from the env-derived value cause startup to fail with a descriptive error.
API keys derived from env vars are inserted into ai_provider_keys at the time the provider row is first created. We do NOT add env-sourced keys to a provider that already has keys, because operators may have added or rotated keys via the API after the initial seed and we do not want to clobber that state on every restart.
Only env-sourced providers participate in the seed; rows created via the HTTP CRUD endpoints are not affected.
Audit entries are recorded via the system actor for any inserts.
@securitydefinitions.apiKey AIGatewayKey @in header @name X-AI-Governance-Gateway-Key New constructs a Coder API handler.
AIGatewayHandler returns the in-memory AI Gateway HTTP handler set by API.RegisterInMemoryAIBridgedHTTPHandler, or nil if the daemon has not been wired in. Callers must apply their own http.StripPrefix for the route prefix they are mounting under.
AssignableSiteRoles returns all site wide roles that can be assigned.
@Summary Get site member roles @ID get-site-member-roles @Security CoderSessionToken @Produce json @Tags Members @Success 200 {array} codersdk.AssignableRoles @Router /api/v2/users/roles [get]
Authorize will return false if the user is not authorized to do the action. This function will log appropriately, but the caller must return an error to the api client. Eg:
if !api.Authorize(...) { httpapi.Forbidden(rw) return }ChatDaemonForTest returns the background chat processor for test harnesses.
CreateInMemoryAIBridgeServer creates a aibridged.DRPCServer and returns a aibridged.DRPCClient to it, connected over an in-memory transport. This server is responsible for all the Coder-specific functionality that aibridged requires such as persistence and retrieving configuration.
CreateInMemoryProvisionerDaemon is an in-memory connection to a provisionerd. Useful when starting coderd and provisionerd in the same process.
PrimaryRegion exposes the user facing values of a workspace proxy to be used by a user.
PrimaryWorkspaceProxy returns the primary workspace proxy for the site.
RegisterInMemoryAIBridgedHTTPHandler mounts aibridged.Server's HTTP router onto API's router, so that requests to aibridged will be relayed from Coder's API server to the in-memory aibridged.
This also registers an in-process agplaibridge.TransportFactory so that chatd can route coder-agent LLM traffic through aibridge without crossing the HTTP route. No license entitlement gate is applied at the factory layer: the entitlement check stays on the HTTP route for external callers, while in-process coder-agent traffic is the explicit carve-out.
ValidWorkspaceAppHostname checks if the given host is a valid workspace app hostname based on the provided options. It returns a scheme to force on success. If the hostname is not valid or doesn't match, an empty string is returned. Any error returned is a 500 error.
For hosts that match a wildcard app hostname, the scheme is forced to be the corresponding access URL scheme.
GithubOAuth2Provider exposes required functions for the Github authentication flow.
GithubOAuth2Team represents a team scoped to an organization.
Authorize will return false if the user is not authorized to do the action. This function will log appropriately, but the caller must return an error to the api client. Eg:
if !h.Authorize(...) { httpapi.Forbidden(rw) return }AuthorizeContext checks whether the RBAC subject on the context is authorized to perform the given action. The subject must have been set via dbauthz.As or the ExtractAPIKey middleware. Returns false if the subject is missing or unauthorized.
AuthorizeSQLFilter returns an authorization filter that can used in a SQL 'WHERE' clause. If the filter is used, the resulting rows returned from postgres are already authorized, and the caller does not need to call 'Authorize()' on the returned objects. Note the authorization is only for the given action and object type.
AuthorizeSQLFilterContext is like AuthorizeSQLFilter but reads the RBAC subject from the context directly rather than from an *http.Request. The subject must have been set via dbauthz.As.
InmemTailnetDialer is a tailnet.ControlProtocolDialer that connects to a Coordinator and DERPMap service running in the same memory space.
MultiAgentController is a tailnet.CoordinationController for connecting to multiple workspace agents. It keeps track of connection times to the agents, and removes them on a timer if they have no active connections and haven't been used in a while.
PKCESupported is to prevent nil pointer dereference.
Options are requires parameters for Coder to start.
ProfileCollector abstracts the mechanics of collecting pprof/trace data from the Go runtime. Production code uses defaultProfileCollector; tests can substitute a stub to avoid process-global side-effects.
NewServerTailnet creates a new tailnet intended for use by coderd.
Conn is used to access the underlying tailnet conn of the ServerTailnet. It should only be used for read-only purposes.
TaskLogSnapshotEnvelope wraps a task log snapshot with format metadata.
WorkspaceAgentRPCMetrics holds Prometheus metrics for the agent connection monitor. It is nil when Prometheus is not enabled.
NewWorkspaceAgentRPCMetrics creates and registers agent connection metrics.
ObserveAgentFirstConnection records the duration from agent creation to first connection. Negative durations are logged as warnings and not recorded, since they indicate clock skew.
|
Package aibridge provides utilities for the AI Bridge feature.
|
Package aibridge provides utilities for the AI Bridge feature. |
|
budget
Package budget resolves the effective AI spend budget for a user.
|
Package budget resolves the effective AI spend budget for a user. |
|
prices
Package prices seeds the ai_model_prices table from an embedded JSON price book at server startup.
|
Package prices seeds the ai_model_prices table from an embedded JSON price book at server startup. |
|
aibridgedmock
Package aibridgedmock is a generated GoMock package.
|
Package aibridgedmock is a generated GoMock package. |
|
Package aibridgedtest provides helpers for starting an in-process aibridged daemon in tests.
|
Package aibridgedtest provides helpers for starting an in-process aibridged daemon in tests. |
|
Package aiseats is the AGPL version the package.
|
Package aiseats is the AGPL version the package. |
|
Package apidoc Code generated by swaggo/swag.
|
Package apidoc Code generated by swaggo/swag. |
|
Package authlink provides analysis and repair utilities for OIDC user link records stored in the user_links table.
|
Package authlink provides analysis and repair utilities for OIDC user link records stored in the user_links table. |
|
Package autobuild contains logic for scheduling workspace builds in the background.
|
Package autobuild contains logic for scheduling workspace builds in the background. |
|
Package boundaryusage tracks workspace boundary usage for telemetry reporting.
|
Package boundaryusage tracks workspace boundary usage for telemetry reporting. |
|
Package cachecompress creates a compressed cache of static files based on an http.FS.
|
Package cachecompress creates a compressed cache of static files based on an http.FS. |
|
promhelp
Package promhelp provides helper functions for asserting Prometheus metric values in unit tests.
|
Package promhelp provides helper functions for asserting Prometheus metric values in unit tests. |
|
Package cryptokeys provides an abstraction for fetching internally used cryptographic keys mainly for JWT signing and verification.
|
Package cryptokeys provides an abstraction for fetching internally used cryptographic keys mainly for JWT signing and verification. |
|
Code generated by scripts/dbgen/main.go.
|
Code generated by scripts/dbgen/main.go. |
|
db2sdk
Package db2sdk provides common conversion routines from database types to codersdk types
|
Package db2sdk provides common conversion routines from database types to codersdk types |
|
dbauthz
Package dbauthz provides an authorization layer on top of the database.
|
Package dbauthz provides an authorization layer on top of the database. |
|
dbmetrics
Code generated by scripts/dbgen.
|
Code generated by scripts/dbgen. |
|
dbmock
Package dbmock is a generated GoMock package.
|
Package dbmock is a generated GoMock package. |
|
gen/dump
command
|
|
|
gentest
Package gentest contains tests that are run at db generate time.
|
Package gentest contains tests that are run at db generate time. |
|
pubsub/psmock
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests
|
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests |
|
sdk2db
Package sdk2db provides common conversion routines from codersdk types to database types
|
Package sdk2db provides common conversion routines from codersdk types to database types |
|
rendermock
Package rendermock is a generated GoMock package.
|
Package rendermock is a generated GoMock package. |
|
httpapiconstraints
Package httpapiconstraints contain types that can be used and implemented across the application to return specific HTTP status codes without pulling in large dependency trees.
|
Package httpapiconstraints contain types that can be used and implemented across the application to return specific HTTP status codes without pulling in large dependency trees. |
|
httperror
Package httperror handles formatting and writing some sentinel errors returned within coder to the API.
|
Package httperror handles formatting and writing some sentinel errors returned within coder to the API. |
|
loggermw/loggermock
Package loggermock is a generated GoMock package.
|
Package loggermock is a generated GoMock package. |
|
notificationsmock
Package notificationsmock contains a mocked implementation of the notifications.Enqueuer interface for use in tests.
|
Package notificationsmock contains a mocked implementation of the notifications.Enqueuer interface for use in tests. |
|
oauth2providertest
Package oauth2providertest provides comprehensive testing utilities for OAuth2 identity provider functionality.
|
Package oauth2providertest provides comprehensive testing utilities for OAuth2 identity provider functionality. |
|
Package promoauth is for instrumenting oauth2 flows with prometheus metrics.
|
Package promoauth is for instrumenting oauth2 flows with prometheus metrics. |
|
Code generated by typegen/main.go.
|
Code generated by typegen/main.go. |
|
regosql
Package regosql converts rego queries into SQL WHERE clauses.
|
Package regosql converts rego queries into SQL WHERE clauses. |
|
regosql/sqltypes
Package sqltypes contains the types used to convert rego queries into SQL.
|
Package sqltypes contains the types used to convert rego queries into SQL. |
|
Package runtimeconfig contains logic for managing runtime configuration values stored in the database.
|
Package runtimeconfig contains logic for managing runtime configuration values stored in the database. |
|
cron
package schedule provides utilities for managing template and workspace autostart and autostop schedules.
|
package schedule provides utilities for managing template and workspace autostart and autostop schedules. |
|
Package updatecheck provides a mechanism for periodically checking for updates to Coder.
|
Package updatecheck provides a mechanism for periodically checking for updates to Coder. |
|
usagetypes
Package usagetypes contains the types for usage events.
|
Package usagetypes contains the types for usage events. |
|
util
|
|
|
lazy
Package lazy provides a lazy value implementation.
|
Package lazy provides a lazy value implementation. |
|
namesgenerator
Package namesgenerator generates random names.
|
Package namesgenerator generates random names. |
|
ptr
Package ptr contains some utility methods related to pointers.
|
Package ptr contains some utility methods related to pointers. |
|
shellparse
Package shellparse extracts command steps from shell scripts.
|
Package shellparse extracts command steps from shell scripts. |
|
tz
Package tz includes utilities for cross-platform timezone/location detection.
|
Package tz includes utilities for cross-platform timezone/location detection. |
|
appurl
Package appurl handles all parsing/validation/etc around application URLs.
|
Package appurl handles all parsing/validation/etc around application URLs. |
|
Package wsbuilder provides the Builder object, which encapsulates the common business logic of inserting a new workspace build into the database.
|
Package wsbuilder provides the Builder object, which encapsulates the common business logic of inserting a new workspace build into the database. |
|
x
|
|
|
chatd
Package chatd implements the internal chat service used by Agents.
|
Package chatd implements the internal chat service used by Agents. |
|
chatd/chatretry
Package chatretry provides retry logic for transient LLM provider errors.
|
Package chatretry provides retry logic for transient LLM provider errors. |
|
chatd/chatstate
Package chatstate owns the durable execution-state transitions for the chatd subsystem.
|
Package chatstate owns the durable execution-state transitions for the chatd subsystem. |
|
chatd/messagepartbuffer
Package messagepartbuffer stores the transient message-part stream that a chat worker emits before those parts are committed to durable chat history.
|
Package messagepartbuffer stores the transient message-part stream that a chat worker emits before those parts are committed to durable chat history. |
|
nats/natsbench
command
Command natsbench benchmarks Coder's NATS-backed pubsub (github.com/coder/coder/v2/coderd/x/nats) under high fan-out load.
|
Command natsbench benchmarks Coder's NATS-backed pubsub (github.com/coder/coder/v2/coderd/x/nats) under high fan-out load. |
|
skills
Package skills defines the shared model for personal and workspace skills used by chatd.
|
Package skills defines the shared model for personal and workspace skills used by chatd. |
| ? | : This menu |
| / | : Search site |
| f or F | : Jump to |
| y or Y | : Canonical URL |