New creates a Coder client for the provided URL.
(serverURL *url.URL, opts ...ClientOption)
| 116 | |
| 117 | // New creates a Coder client for the provided URL. |
| 118 | func New(serverURL *url.URL, opts ...ClientOption) *Client { |
| 119 | client := &Client{ |
| 120 | URL: serverURL, |
| 121 | HTTPClient: &http.Client{}, |
| 122 | SessionTokenProvider: FixedSessionTokenProvider{}, |
| 123 | } |
| 124 | for _, opt := range opts { |
| 125 | opt(client) |
| 126 | } |
| 127 | return client |
| 128 | } |
| 129 | |
| 130 | // Client is an HTTP caller for methods to the Coder API. |
| 131 | // @typescript-ignore Client |
no outgoing calls