Documentation ¶
Overview ¶
Package fake is used to help with testing functions that need a fake RuntimeClient.
Index ¶
- type RuntimeClient
- func (fc *RuntimeClient) CallAllCount(hook runtimecatalog.Hook) int
- func (fc *RuntimeClient) CallAllExtensions(ctx context.Context, hook runtimecatalog.Hook, _ metav1.Object, ...) error
- func (fc *RuntimeClient) CallExtension(ctx context.Context, _ runtimecatalog.Hook, _ metav1.Object, name string, ...) error
- func (fc *RuntimeClient) Discover(context.Context, *runtimev1.ExtensionConfig) (*runtimev1.ExtensionConfig, error)
- func (fc *RuntimeClient) IsReady() bool
- func (fc *RuntimeClient) Register(_ *runtimev1.ExtensionConfig) error
- func (fc *RuntimeClient) Unregister(_ *runtimev1.ExtensionConfig) error
- func (fc *RuntimeClient) WarmUp(_ *runtimev1.ExtensionConfigList) error
- type RuntimeClientBuilder
- func (f *RuntimeClientBuilder) Build() *RuntimeClient
- func (f *RuntimeClientBuilder) MarkReady(ready bool) *RuntimeClientBuilder
- func (f *RuntimeClientBuilder) WithCallAllExtensionResponses(responses map[runtimecatalog.GroupVersionHook]runtimehooksv1.ResponseObject) *RuntimeClientBuilder
- func (f *RuntimeClientBuilder) WithCallExtensionResponses(responses map[string]runtimehooksv1.ResponseObject) *RuntimeClientBuilder
- func (f *RuntimeClientBuilder) WithCatalog(catalog *runtimecatalog.Catalog) *RuntimeClientBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuntimeClient ¶
type RuntimeClient struct {
// contains filtered or unexported fields
}
RuntimeClient is a fake implementation of runtimeclient.Client.
func (*RuntimeClient) CallAllCount ¶
func (fc *RuntimeClient) CallAllCount(hook runtimecatalog.Hook) int
CallAllCount return the number of times a hook was called.
func (*RuntimeClient) CallAllExtensions ¶
func (fc *RuntimeClient) CallAllExtensions(ctx context.Context, hook runtimecatalog.Hook, _ metav1.Object, _ runtimehooksv1.RequestObject, response runtimehooksv1.ResponseObject) error
CallAllExtensions implements Client.
func (*RuntimeClient) CallExtension ¶
func (fc *RuntimeClient) CallExtension(ctx context.Context, _ runtimecatalog.Hook, _ metav1.Object, name string, _ runtimehooksv1.RequestObject, response runtimehooksv1.ResponseObject) error
CallExtension implements Client.
func (*RuntimeClient) Discover ¶
func (fc *RuntimeClient) Discover(context.Context, *runtimev1.ExtensionConfig) (*runtimev1.ExtensionConfig, error)
Discover implements Client.
func (*RuntimeClient) Register ¶
func (fc *RuntimeClient) Register(_ *runtimev1.ExtensionConfig) error
Register implements Client.
func (*RuntimeClient) Unregister ¶
func (fc *RuntimeClient) Unregister(_ *runtimev1.ExtensionConfig) error
Unregister implements Client.
func (*RuntimeClient) WarmUp ¶
func (fc *RuntimeClient) WarmUp(_ *runtimev1.ExtensionConfigList) error
WarmUp implements Client.
type RuntimeClientBuilder ¶
type RuntimeClientBuilder struct {
// contains filtered or unexported fields
}
RuntimeClientBuilder is used to build a fake runtime client.
func NewRuntimeClientBuilder ¶
func NewRuntimeClientBuilder() *RuntimeClientBuilder
NewRuntimeClientBuilder returns a new builder for the fake runtime client.
func (*RuntimeClientBuilder) Build ¶
func (f *RuntimeClientBuilder) Build() *RuntimeClient
Build returns the fake runtime client.
func (*RuntimeClientBuilder) MarkReady ¶
func (f *RuntimeClientBuilder) MarkReady(ready bool) *RuntimeClientBuilder
MarkReady can be used to mark the fake runtime client as either ready or not ready.
func (*RuntimeClientBuilder) WithCallAllExtensionResponses ¶
func (f *RuntimeClientBuilder) WithCallAllExtensionResponses(responses map[runtimecatalog.GroupVersionHook]runtimehooksv1.ResponseObject) *RuntimeClientBuilder
WithCallAllExtensionResponses can be used to dictate the responses for CallAllExtensions.
func (*RuntimeClientBuilder) WithCallExtensionResponses ¶
func (f *RuntimeClientBuilder) WithCallExtensionResponses(responses map[string]runtimehooksv1.ResponseObject) *RuntimeClientBuilder
WithCallExtensionResponses can be used to dictate the responses for CallExtension.
func (*RuntimeClientBuilder) WithCatalog ¶
func (f *RuntimeClientBuilder) WithCatalog(catalog *runtimecatalog.Catalog) *RuntimeClientBuilder
WithCatalog can be use the provided catalog in the fake runtime client.