dynamic

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnstructuredCRDFromGVK added in v0.16.1

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

UnstructuredCRDFromGVK constructs an unstructured object using the given GVK

Types

type ClientRecorder added in v0.17.0

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

ClientRecorder is recorder for eventing objects

func (*ClientRecorder) ListCRDs added in v0.17.0

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 added in v0.18.0

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

ListChannelsTypes returns installed knative messaging CRDs

func (*ClientRecorder) ListChannelsUsingGVKs added in v0.18.0

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 added in v0.17.0

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

ListSources returns list of available sources objects

func (*ClientRecorder) ListSourcesTypes added in v0.17.0

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

ListSourcesTypes returns installed knative eventing sources CRDs

func (*ClientRecorder) ListSourcesUsingGVKs added in v0.17.0

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 added in v0.17.0

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

RawClient creates a client

func (*ClientRecorder) Validate added in v0.17.0

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 added in v0.17.0

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

MockKnDynamicClient is a combine of test object and recorder

func NewMockKnDynamicClient added in v0.19.0

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

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

func (*MockKnDynamicClient) ListCRDs added in v0.17.0

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

func (*MockKnDynamicClient) ListChannelsTypes added in v0.18.0

ListChannelsTypes returns installed knative messaging CRDs

func (*MockKnDynamicClient) ListChannelsUsingGVKs added in v0.18.0

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 added in v0.17.0

ListSources returns list of available sources objects

func (*MockKnDynamicClient) ListSourcesTypes added in v0.17.0

ListSourcesTypes returns installed knative eventing sources CRDs

func (*MockKnDynamicClient) ListSourcesUsingGVKs added in v0.17.0

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 added in v0.17.0

func (c *MockKnDynamicClient) Namespace() string

Namespace of this client

func (*MockKnDynamicClient) RawClient added in v0.17.0

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

RawClient creates a client

func (*MockKnDynamicClient) Recorder added in v0.17.0

func (c *MockKnDynamicClient) Recorder() *ClientRecorder

Recorder returns the recorder for registering API calls

type TypesFilter added in v0.13.0

type TypesFilter []string

TypesFilter for keeping list of sources types to filter upo

type WithType added in v0.13.0

type WithType func(filters *TypesFilter)

WithType function for easy filtering on source types

func WithTypeFilter added in v0.13.0

func WithTypeFilter(name string) WithType

WithTypeFilter can be used to filter based on source type name

type WithTypes added in v0.13.0

type WithTypes []WithType

WithTypes for recording the source type filtering function WithType

func (WithTypes) List added in v0.13.0

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