fake

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fake is used to help with testing functions that need a fake RuntimeClient.

Index

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

CallAllExtensions implements Client.

func (*RuntimeClient) CallExtension

CallExtension implements Client.

func (*RuntimeClient) Discover

Discover implements Client.

func (*RuntimeClient) IsReady

func (fc *RuntimeClient) IsReady() bool

IsReady 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

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

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

WithCatalog can be use the provided catalog in the fake runtime client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL