v1

package
v0.0.0-...-14f4a3a Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltInChannelGVKs

func BuiltInChannelGVKs() []schema.GroupVersionKind

BuiltInChannelGVKs returns the GVKs for built in channel

Types

type ChannelBuilder

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

ChannelBuilder is for building the Channel object

func NewChannelBuilder

func NewChannelBuilder(name, namespace string) *ChannelBuilder

NewChannelBuilder for building Channel object

func (*ChannelBuilder) Build

func (c *ChannelBuilder) Build() *messagingv1.Channel

Build returns the Channel object from the builder

func (*ChannelBuilder) Type

Type sets the type of the channel to create

func (*ChannelBuilder) WithGvk

func (c *ChannelBuilder) WithGvk() *ChannelBuilder

WithGvk sets the GVK on the channel

type ChannelsRecorder

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

recorder for service

func (*ChannelsRecorder) CreateChannel

func (sr *ChannelsRecorder) CreateChannel(channels interface{}, err error)

CreateChannel records a call for CreateChannel with the expected error

func (*ChannelsRecorder) DeleteChannel

func (sr *ChannelsRecorder) DeleteChannel(name interface{}, err error)

DeleteChannel records a call for DeleteChannel with the expected error (nil if none)

func (*ChannelsRecorder) GetChannel

func (sr *ChannelsRecorder) GetChannel(name interface{}, channels *messagingv1.Channel, err error)

GetChannel records a call for GetChannel with the expected object or error. Either channels or err should be nil

func (*ChannelsRecorder) ListChannel

func (sr *ChannelsRecorder) ListChannel(channelsList *messagingv1.ChannelList, err error)

ListChannel records a call for ListChannel with the expected error (nil if none)

func (*ChannelsRecorder) Validate

func (sr *ChannelsRecorder) Validate()

Validates validates whether every recorded action has been called

type KnChannelsClient

type KnChannelsClient interface {

	// GetChannel returns a Channel by its name
	GetChannel(ctx context.Context, name string) (*messagingv1.Channel, error)

	// CreteChannel creates a Channel with given spec
	CreateChannel(ctx context.Context, channel *messagingv1.Channel) error

	// DeleteChannel deletes a Channel by its name
	DeleteChannel(ctx context.Context, name string) error

	// ListChannel lists all Channels
	ListChannel(ctx context.Context) (*messagingv1.ChannelList, error)

	// Namespace returns the namespace for this channel client
	Namespace() string
}

KnChannelsClient for interacting with Channels

type KnMessagingClient

type KnMessagingClient interface {
	// Get the Channels client
	ChannelsClient() KnChannelsClient

	// Get the Subscriptions client
	SubscriptionsClient() KnSubscriptionsClient
}

KnMessagingClient to Eventing Messaging. All methods are relative to the namespace specified during construction

func NewKnMessagingClient

func NewKnMessagingClient(client clientv1beta1.MessagingV1Interface, namespace string) KnMessagingClient

NewKnMessagingClient for managing all eventing messaging types

type KnSubscriptionsClient

type KnSubscriptionsClient interface {

	// GetSubscription returns a Subscription by its name
	GetSubscription(ctx context.Context, name string) (*messagingv1.Subscription, error)

	// CreateSubscription creates a Subscription with given spec
	CreateSubscription(ctx context.Context, subscription *messagingv1.Subscription) error

	// UpdateSubscription updates a Subscription with given spec
	UpdateSubscription(ctx context.Context, subscription *messagingv1.Subscription) error

	// UpdateSubscriptionWithRetry updates a Subscription and retries on conflict error
	UpdateSubscriptionWithRetry(ctx context.Context, name string, updateFunc SubscriptionUpdateFunc, nrRetries int) error

	// DeleteSubscription deletes a Subscription by its name
	DeleteSubscription(ctx context.Context, name string) error

	// ListSubscription lists all Subscriptions
	ListSubscription(ctx context.Context) (*messagingv1.SubscriptionList, error)

	// Namespace returns the namespace for this subscription client
	Namespace() string
}

KnSubscriptionsClient for interacting with Subscriptions

type MockKnChannelsClient

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

func NewMockKnChannelsClient

func NewMockKnChannelsClient(t *testing.T, ns ...string) *MockKnChannelsClient

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

func (*MockKnChannelsClient) CreateChannel

func (c *MockKnChannelsClient) CreateChannel(ctx context.Context, channels *messagingv1.Channel) error

CreateChannel performs a previously recorded action, failing if non has been registered

func (*MockKnChannelsClient) DeleteChannel

func (c *MockKnChannelsClient) DeleteChannel(ctx context.Context, name string) error

DeleteChannel performs a previously recorded action, failing if non has been registered

func (*MockKnChannelsClient) GetChannel

func (c *MockKnChannelsClient) GetChannel(ctx context.Context, name string) (*messagingv1.Channel, error)

GetChannel performs a previously recorded action, failing if non has been registered

func (*MockKnChannelsClient) ListChannel

ListChannel performs a previously recorded action, failing if non has been registered

func (*MockKnChannelsClient) Namespace

func (c *MockKnChannelsClient) Namespace() string

Namespace of this client

func (*MockKnChannelsClient) Recorder

func (c *MockKnChannelsClient) Recorder() *ChannelsRecorder

Recorder returns the recorder for registering API calls

type MockKnSubscriptionsClient

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

func NewMockKnSubscriptionsClient

func NewMockKnSubscriptionsClient(t *testing.T, ns ...string) *MockKnSubscriptionsClient

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

func (*MockKnSubscriptionsClient) CreateSubscription

func (c *MockKnSubscriptionsClient) CreateSubscription(ctx context.Context, subscription *messagingv1.Subscription) error

CreateSubscription performs a previously recorded action, failing if non has been registered

func (*MockKnSubscriptionsClient) DeleteSubscription

func (c *MockKnSubscriptionsClient) DeleteSubscription(ctx context.Context, name string) error

DeleteSubscription performs a previously recorded action, failing if non has been registered

func (*MockKnSubscriptionsClient) GetSubscription

func (c *MockKnSubscriptionsClient) GetSubscription(ctx context.Context, name string) (*messagingv1.Subscription, error)

GetSubscription performs a previously recorded action, failing if non has been registered

func (*MockKnSubscriptionsClient) ListSubscription

ListSubscription performs a previously recorded action, failing if non has been registered

func (*MockKnSubscriptionsClient) Namespace

func (c *MockKnSubscriptionsClient) Namespace() string

Namespace of this client

func (*MockKnSubscriptionsClient) Recorder

Recorder returns the recorder for registering API calls

func (*MockKnSubscriptionsClient) UpdateSubscription

func (c *MockKnSubscriptionsClient) UpdateSubscription(ctx context.Context, subscription *messagingv1.Subscription) error

UpdateSubscription performs a previously recorded action, failing if non has been registered

func (*MockKnSubscriptionsClient) UpdateSubscriptionWithRetry

func (c *MockKnSubscriptionsClient) UpdateSubscriptionWithRetry(ctx context.Context, name string, updateFunc SubscriptionUpdateFunc, nrRetries int) error

type SubscriptionBuilder

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

SubscriptionBuilder is for building the Subscription object

func NewSubscriptionBuilder

func NewSubscriptionBuilder(name string) *SubscriptionBuilder

NewSubscriptionBuilder for building Subscription object

func NewSubscriptionBuilderFromExisting

func NewSubscriptionBuilderFromExisting(subs *messagingv1.Subscription) *SubscriptionBuilder

NewSubscriptionBuilderFromExisting for building Subscription object from existing Subscription object

func (*SubscriptionBuilder) Build

Build returns the Subscription object from the builder

func (*SubscriptionBuilder) Channel

Channel sets the channel reference for this subscription

func (*SubscriptionBuilder) DeadLetterSink

func (s *SubscriptionBuilder) DeadLetterSink(dls *duckv1.Destination) *SubscriptionBuilder

func (*SubscriptionBuilder) Reply

func (*SubscriptionBuilder) Subscriber

type SubscriptionUpdateFunc

type SubscriptionUpdateFunc func(origSub *messagingv1.Subscription) (*messagingv1.Subscription, error)

type SubscriptionsRecorder

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

recorder for service

func (*SubscriptionsRecorder) CreateSubscription

func (sr *SubscriptionsRecorder) CreateSubscription(subscription interface{}, err error)

CreateSubscription records a call for CreateSubscription with the expected error

func (*SubscriptionsRecorder) DeleteSubscription

func (sr *SubscriptionsRecorder) DeleteSubscription(name interface{}, err error)

DeleteSubscription records a call for DeleteSubscription with the expected error (nil if none)

func (*SubscriptionsRecorder) GetSubscription

func (sr *SubscriptionsRecorder) GetSubscription(name interface{}, subscription *messagingv1.Subscription, err error)

GetSubscription records a call for GetSubscription with the expected object or error. Either subscriptions or err should be nil

func (*SubscriptionsRecorder) ListSubscription

func (sr *SubscriptionsRecorder) ListSubscription(subscriptionsList *messagingv1.SubscriptionList, err error)

ListSubscription records a call for ListSubscription with the expected error (nil if none)

func (*SubscriptionsRecorder) UpdateSubscription

func (sr *SubscriptionsRecorder) UpdateSubscription(subscription interface{}, err error)

UpdateSubscription records a call for CreateSubscription with the expected error

func (*SubscriptionsRecorder) Validate

func (sr *SubscriptionsRecorder) Validate()

Validates validates whether every recorded action has been called

Jump to

Keyboard shortcuts

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