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

Struct Client

codersdk/client.go:132–161  ·  view source on GitHub ↗

Client is an HTTP caller for methods to the Coder API. @typescript-ignore Client

Source from the content-addressed store, hash-verified

130// Client is an HTTP caller for methods to the Coder API.
131// @typescript-ignore Client
132type Client struct {
133 // mu protects the fields sessionToken, logger, and logBodies. These
134 // need to be safe for concurrent access.
135 mu sync.RWMutex
136 SessionTokenProvider SessionTokenProvider
137 logger slog.Logger
138 logBodies bool
139
140 HTTPClient *http.Client
141 URL *url.URL
142
143 // PlainLogger may be set to log HTTP traffic in a human-readable form.
144 // It uses the LogBodies option.
145 // Deprecated: Use WithPlainLogger to set this.
146 PlainLogger io.Writer
147
148 // Trace can be enabled to propagate tracing spans to the Coder API.
149 // This is useful for tracking a request end-to-end.
150 // Deprecated: Use WithTrace to set this.
151 Trace bool
152
153 // DisableDirectConnections forces any connections to workspaces to go
154 // through DERP, regardless of the BlockEndpoints setting on each
155 // connection.
156 // Deprecated: Use WithDisableDirectConnections to set this.
157 DisableDirectConnections bool
158
159 // derpTLSConfig is an optional TLS config for DERP connections.
160 derpTLSConfig *tls.Config
161}
162
163// Logger returns the logger for the client.
164func (c *Client) Logger() slog.Logger {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected