Documentation ¶
Index ¶
- func UnstructuredCRDFromGVK(gvk schema.GroupVersionKind) *unstructured.Unstructured
- type ClientRecorder
- func (dr *ClientRecorder) ListCRDs(options interface{}, ulist *unstructured.UnstructuredList, err error)
- func (dr *ClientRecorder) ListChannelsTypes(ulist *unstructured.UnstructuredList, err error)
- func (dr *ClientRecorder) ListChannelsUsingGVKs(gvks interface{}, types interface{}, ulist *unstructured.UnstructuredList, ...)
- func (dr *ClientRecorder) ListSources(types interface{}, ulist *unstructured.UnstructuredList, err error)
- func (dr *ClientRecorder) ListSourcesTypes(ulist *unstructured.UnstructuredList, err error)
- func (dr *ClientRecorder) ListSourcesUsingGVKs(gvks interface{}, types interface{}, ulist *unstructured.UnstructuredList, ...)
- func (dr *ClientRecorder) RawClient(dynamicInterface dynamic.Interface)
- func (dr *ClientRecorder) Validate()
- type KnDynamicClient
- type MockKnDynamicClient
- func (c *MockKnDynamicClient) ListCRDs(ctx context.Context, options metav1.ListOptions) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) ListChannelsTypes(context.Context) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) ListChannelsUsingGVKs(ctx context.Context, gvks *[]schema.GroupVersionKind, types ...WithType) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) ListSources(ctx context.Context, types ...WithType) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) ListSourcesTypes(context.Context) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) ListSourcesUsingGVKs(ctx context.Context, gvks *[]schema.GroupVersionKind, types ...WithType) (*unstructured.UnstructuredList, error)
- func (c *MockKnDynamicClient) Namespace() string
- func (c *MockKnDynamicClient) RawClient() (dynamicInterface dynamic.Interface)
- func (c *MockKnDynamicClient) Recorder() *ClientRecorder
- type TypesFilter
- type WithType
- type WithTypes
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 ¶
func (c *MockKnDynamicClient) ListCRDs(ctx context.Context, options metav1.ListOptions) (*unstructured.UnstructuredList, error)
ListCRDs returns list of installed CRDs in the cluster and filters based on the given options
func (*MockKnDynamicClient) ListChannelsTypes ¶
func (c *MockKnDynamicClient) ListChannelsTypes(context.Context) (*unstructured.UnstructuredList, error)
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 ¶
func (c *MockKnDynamicClient) ListSources(ctx context.Context, types ...WithType) (*unstructured.UnstructuredList, error)
ListSources returns list of available sources objects
func (*MockKnDynamicClient) ListSourcesTypes ¶
func (c *MockKnDynamicClient) ListSourcesTypes(context.Context) (*unstructured.UnstructuredList, error)
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 ¶
WithTypeFilter can be used to filter based on source type name