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

Method asRequestOption

codersdk/apikey.go:115–122  ·  view source on GitHub ↗

asRequestOption returns a function that can be used in (*Client).Request. It modifies the request query parameters.

()

Source from the content-addressed store, hash-verified

113// asRequestOption returns a function that can be used in (*Client).Request.
114// It modifies the request query parameters.
115func (f TokensFilter) asRequestOption() RequestOption {
116 return func(r *http.Request) {
117 q := r.URL.Query()
118 q.Set("include_all", fmt.Sprintf("%t", f.IncludeAll))
119 q.Set("include_expired", fmt.Sprintf("%t", f.IncludeExpired))
120 r.URL.RawQuery = q.Encode()
121 }
122}
123
124// Tokens list machine API keys.
125func (c *Client) Tokens(ctx context.Context, userID string, filter TokensFilter) ([]APIKeyWithOwner, error) {

Callers 1

TokensMethod · 0.45

Calls 2

EncodeMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected