dynamic

package
v0.0.0-...-441372a Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnstructuredCRDFromGVK

func UnstructuredCRDFromGVK(gvk schema.GroupVersionKind) *unstructured.Unstructured

UnstructuredCRDFromGVK constructs an unstructured object using the given GVK

Types

type ClientRecorder

type ClientRecorder struct {
	// contains filtered or unexported fields
}

ClientRecorder is recorder for eventing objects

func (*ClientRecorder) ListCRDs

func (dr *ClientRecorder) ListCRDs(options interface{}, ulist *unstructured.UnstructuredList, err error)

ListCRDs returns list of installed CRDs in the cluster and filters based on the given options

func (*ClientRecorder) ListChannelsTypes

func (dr *ClientRecorder) ListChannelsTypes(ulist *unstructured.UnstructuredList, err error)

ListChannelsTypes returns installed knative messaging CRDs

func (*ClientRecorder) ListChannelsUsingGVKs

func (dr *ClientRecorder) ListChannelsUsingGVKs(gvks interface{}, types interface{}, ulist *unstructured.UnstructuredList, err error)

ListChannelsUsingGVKs returns list of available channel objects using given list of GVKs

func (*ClientRecorder) ListSources

func (dr *ClientRecorder) ListSources(types interface{}, ulist *unstructured.UnstructuredList, err error)

ListSources returns list of available sources objects

func (*ClientRecorder) ListSourcesTypes

func (dr *ClientRecorder) ListSourcesTypes(ulist *unstructured.UnstructuredList, err error)

ListSourcesTypes returns installed knative eventing sources CRDs

func (*ClientRecorder) ListSourcesUsingGVKs

func (dr *ClientRecorder) ListSourcesUsingGVKs(gvks interface{}, types interface{}, ulist *unstructured.UnstructuredList, err error)

ListSourcesUsingGVKs returns list of available source objects using given list of GVKs

func (*ClientRecorder) RawClient

func (dr *ClientRecorder) RawClient(dynamicInterface dynamic.Interface)

RawClient creates a client

func (*ClientRecorder) Validate

func (dr *ClientRecorder) Validate()

Validate validates whether every recorded action has been called

type KnDynamicClient

type KnDynamicClient interface {
	// Namespace in which this client is operating for
	Namespace() string

	// ListCRDs returns list of CRDs with their type and name
	ListCRDs(ctx context.Context, options metav1.ListOptions) (*unstructured.UnstructuredList, error)

	// ListSourcesTypes returns list of eventing sources CRDs
	ListSourcesTypes(ctx context.Context) (*unstructured.UnstructuredList, error)

	// ListSources returns list of available source objects
	ListSources(ctx context.Context, types ...WithType) (*unstructured.UnstructuredList, error)

	// ListSourcesUsingGVKs returns list of available source objects using given list of GVKs
	ListSourcesUsingGVKs(context.Context, *[]schema.GroupVersionKind, ...WithType) (*unstructured.UnstructuredList, error)

	// ListChannelsTypes returns installed knative channel CRDs
	ListChannelsTypes(ctx context.Context) (*unstructured.UnstructuredList, error)

	// ListChannelsUsingGVKs returns list of available channel objects using given list of GVKs
	ListChannelsUsingGVKs(context.Context, *[]schema.GroupVersionKind, ...WithType) (*unstructured.UnstructuredList, error)

	// RawClient returns the raw dynamic client interface
	RawClient() dynamic.Interface
}

KnDynamicClient to client-go Dynamic client. All methods are relative to the namespace specified during construction

func NewKnDynamicClient

func NewKnDynamicClient(client dynamic.Interface, namespace string) KnDynamicClient

NewKnDynamicClient is to invoke Eventing Sources Client API to create object

type MockKnDynamicClient

type MockKnDynamicClient struct {
	// contains filtered or unexported fields
}

MockKnDynamicClient is a combine of test object and recorder

func NewMockKnDynamicClient

func NewMockKnDynamicClient(t *testing.T, ns ...string) *MockKnDynamicClient

NewMockKnDynamicClient returns a new mock instance which you need to record for

func (*MockKnDynamicClient) ListCRDs

ListCRDs returns list of installed CRDs in the cluster and filters based on the given options

func (*MockKnDynamicClient) ListChannelsTypes

ListChannelsTypes returns installed knative messaging CRDs

func (*MockKnDynamicClient) ListChannelsUsingGVKs

func (c *MockKnDynamicClient) ListChannelsUsingGVKs(ctx context.Context, gvks *[]schema.GroupVersionKind, types ...WithType) (*unstructured.UnstructuredList, error)

ListChannelsUsingGVKs returns list of available channel objects using given list of GVKs

func (*MockKnDynamicClient) ListSources

ListSources returns list of available sources objects

func (*MockKnDynamicClient) ListSourcesTypes

ListSourcesTypes returns installed knative eventing sources CRDs

func (*MockKnDynamicClient) ListSourcesUsingGVKs

func (c *MockKnDynamicClient) ListSourcesUsingGVKs(ctx context.Context, gvks *[]schema.GroupVersionKind, types ...WithType) (*unstructured.UnstructuredList, error)

ListSourcesUsingGVKs returns list of available source objects using given list of GVKs

func (*MockKnDynamicClient) Namespace

func (c *MockKnDynamicClient) Namespace() string

Namespace of this client

func (*MockKnDynamicClient) RawClient

func (c *MockKnDynamicClient) RawClient() (dynamicInterface dynamic.Interface)

RawClient creates a client

func (*MockKnDynamicClient) Recorder

func (c *MockKnDynamicClient) Recorder() *ClientRecorder

Recorder returns the recorder for registering API calls

type TypesFilter

type TypesFilter []string

TypesFilter for keeping list of sources types to filter upo

type WithType

type WithType func(filters *TypesFilter)

WithType function for easy filtering on source types

func WithTypeFilter

func WithTypeFilter(name string) WithType

WithTypeFilter can be used to filter based on source type name

type WithTypes

type WithTypes []WithType

WithTypes for recording the source type filtering function WithType

func (WithTypes) List

func (types WithTypes) List() []string

List returns the source type name list recorded via WithTypeFilter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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