package fake
import "k8s.io/client-go/rest/fake"
This is made a separate package and should only be imported by tests, because it imports testapi
Index ¶
- func CreateHTTPClient(roundTripper func(*http.Request) (*http.Response, error)) *http.Client
- type RESTClient
- func (c *RESTClient) APIVersion() schema.GroupVersion
- func (c *RESTClient) Delete() *restclient.Request
- func (c *RESTClient) Get() *restclient.Request
- func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter
- func (c *RESTClient) Patch(pt types.PatchType) *restclient.Request
- func (c *RESTClient) Post() *restclient.Request
- func (c *RESTClient) Put() *restclient.Request
- func (c *RESTClient) Request() *restclient.Request
- func (c *RESTClient) Verb(verb string) *restclient.Request
Functions ¶
func CreateHTTPClient ¶
CreateHTTPClient creates an http.Client that will invoke the provided roundTripper func when a request is made.
Types ¶
type RESTClient ¶
type RESTClient struct { NegotiatedSerializer runtime.NegotiatedSerializer GroupVersion schema.GroupVersion VersionedAPIPath string // Err is returned when any request would be made to the server. If Err is set, // Req will not be recorded, Resp will not be returned, and Client will not be // invoked. Err error // Req is set to the last request that was executed (had the methods Do/DoRaw) invoked. Req *http.Request // If Client is specified, the client will be invoked instead of returning Resp if // Err is not set. Client *http.Client // Resp is returned to the caller after Req is recorded, unless Err or Client are set. Resp *http.Response }
RESTClient provides a fake RESTClient interface. It is used to mock network interactions via a rest.Request, or to make them via the provided Client to a specific server.
func (*RESTClient) APIVersion ¶
func (c *RESTClient) APIVersion() schema.GroupVersion
func (*RESTClient) Delete ¶
func (c *RESTClient) Delete() *restclient.Request
func (*RESTClient) Get ¶
func (c *RESTClient) Get() *restclient.Request
func (*RESTClient) GetRateLimiter ¶
func (c *RESTClient) GetRateLimiter() flowcontrol.RateLimiter
func (*RESTClient) Patch ¶
func (c *RESTClient) Patch(pt types.PatchType) *restclient.Request
func (*RESTClient) Post ¶
func (c *RESTClient) Post() *restclient.Request
func (*RESTClient) Put ¶
func (c *RESTClient) Put() *restclient.Request
func (*RESTClient) Request ¶
func (c *RESTClient) Request() *restclient.Request
func (*RESTClient) Verb ¶
func (c *RESTClient) Verb(verb string) *restclient.Request
Source Files ¶
fake.go
- Version
- v0.24.13
- Published
- Apr 12, 2023
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 19 minutes ago –
Tools for package owners.