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 ¶ 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
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 ¶ added in v0.18.0
func (c *MockKnDynamicClient) ListChannelsTypes(context.Context) (*unstructured.UnstructuredList, error)
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
func (c *MockKnDynamicClient) ListSources(ctx context.Context, types ...WithType) (*unstructured.UnstructuredList, error)
ListSources returns list of available sources objects
func (*MockKnDynamicClient) ListSourcesTypes ¶ added in v0.17.0
func (c *MockKnDynamicClient) ListSourcesTypes(context.Context) (*unstructured.UnstructuredList, error)
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
WithTypeFilter can be used to filter based on source type name