const envBackoffBase … const envBackoffDuration … type Interface … type ClientContentConfig … type RESTClient … // NewRESTClient creates a new RESTClient. This client performs generic REST functions // such as Get, Put, Post, and Delete on specified paths. func NewRESTClient(baseURL *url.URL, versionedAPIPath string, config ClientContentConfig, rateLimiter flowcontrol.RateLimiter, client *http.Client) (*RESTClient, error) { … } func scrubCBORContentConfigIfDisabled(content ClientContentConfig) ClientContentConfig { … } // GetRateLimiter returns rate limiter for a given client, or nil if it's called on a nil client func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter { … } // readExpBackoffConfig handles the internal logic of determining what the // backoff policy is. By default if no information is available, NoBackoff. // TODO Generalize this see #17727 . func readExpBackoffConfig() BackoffManager { … } // Verb begins a request with a verb (GET, POST, PUT, DELETE). // // Example usage of RESTClient's request building interface: // c, err := NewRESTClient(...) // if err != nil { ... } // resp, err := c.Verb("GET"). // // Path("pods"). // SelectorParam("labels", "area=staging"). // Timeout(10*time.Second). // Do() // // if err != nil { ... } // list, ok := resp.(*api.PodList) func (c *RESTClient) Verb(verb string) *Request { … } // Post begins a POST request. Short for c.Verb("POST"). func (c *RESTClient) Post() *Request { … } // Put begins a PUT request. Short for c.Verb("PUT"). func (c *RESTClient) Put() *Request { … } // Patch begins a PATCH request. Short for c.Verb("Patch"). func (c *RESTClient) Patch(pt types.PatchType) *Request { … } // Get begins a GET request. Short for c.Verb("GET"). func (c *RESTClient) Get() *Request { … } // Delete begins a DELETE request. Short for c.Verb("DELETE"). func (c *RESTClient) Delete() *Request { … } // APIVersion returns the APIVersion this RESTClient is expected to use. func (c *RESTClient) APIVersion() schema.GroupVersion { … } type requestClientContentConfigProvider … // GetClientContentConfig returns the ClientContentConfig that should be used for new requests by // this client. func (p *requestClientContentConfigProvider) GetClientContentConfig() ClientContentConfig { … } // UnsupportedMediaType reports that the server has responded to a request with HTTP 415 Unsupported // Media Type. func (p *requestClientContentConfigProvider) UnsupportedMediaType(requestContentType string) { … }