Documentation ¶
Index ¶
- func ContainsString(slice *[]string, s string) bool
- func GetChannelName(sourceID, eventType, eventTypeVersion *string) string
- func GetDefaultChannelNamespace() string
- func GetSubscriptionName(kySubscriptionName, kySubscriptionNamespace *string) string
- func GetSubscriptionsForEventActivation(ctx context.Context, client runtimeClient.Client, ...) ([]*subApis.Subscription, error)
- func RemoveString(slice *[]string, s string) (result []string)
- func UpdateEventActivation(ctx context.Context, client runtimeClient.Client, ...) error
- func UpdateSubscriptionReadyStatus(sub *subApis.Subscription, conditionStatus subApis.ConditionStatus, msg string) *subApis.Subscription
- func UpdateSubscriptionsEventActivatedStatus(subs []*subApis.Subscription, conditionStatus subApis.ConditionStatus) []*subApis.Subscription
- func WriteSubscription(ctx context.Context, client runtimeClient.Client, sub *subApis.Subscription) error
- type KnativeLib
- func (k *KnativeLib) CreateChannel(provisioner string, name string, namespace string, timeout time.Duration) (*evapisv1alpha1.Channel, error)
- func (k *KnativeLib) CreateSubscription(name string, namespace string, channelName string, uri *string) error
- func (k *KnativeLib) DeleteChannel(name string, namespace string) error
- func (k *KnativeLib) DeleteSubscription(name string, namespace string) error
- func (k *KnativeLib) GetChannel(name string, namespace string) (*evapisv1alpha1.Channel, error)
- func (k *KnativeLib) GetSubscription(name string, namespace string) (*evapisv1alpha1.Subscription, error)
- func (r *KnativeLib) InjectClient(c eventingv1alpha1.EventingV1alpha1Interface) error
- func (k *KnativeLib) SendMessage(channel *evapisv1alpha1.Channel, message *string) error
- func (k *KnativeLib) UpdateSubscription(sub *evapisv1alpha1.Subscription) (*evapisv1alpha1.Subscription, error)
- type SubscriptionBuilder
- func (s *SubscriptionBuilder) Build() *eventingv1alpha1.Subscription
- func (s *SubscriptionBuilder) EmptyReply() *SubscriptionBuilder
- func (s *SubscriptionBuilder) ToChannel(name string) *SubscriptionBuilder
- func (s *SubscriptionBuilder) ToK8sService(k8sServiceName string) *SubscriptionBuilder
- func (s *SubscriptionBuilder) ToKNService(knServiceName string) *SubscriptionBuilder
- func (s *SubscriptionBuilder) ToUri(uri *string) *SubscriptionBuilder
- type SubscriptionWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
Helper functions to check and remove string from a slice of strings.
func GetChannelName ¶
GetChannelName function joins the sourceID, eventType and eventTypeVersion respectively with a '-' as a delimiter.
func GetDefaultChannelNamespace ¶
func GetDefaultChannelNamespace() string
GetDefaultChannelNamespace() returns the default namespace of Knative/Eventing channels and subscriptions
func GetSubscriptionName ¶
GetSubscriptionName joins the kySubscriptionName and kySubscriptionNamespace
func GetSubscriptionsForEventActivation ¶
func GetSubscriptionsForEventActivation(ctx context.Context, client runtimeClient.Client, ea *eventingv1alpha1.EventActivation) ([]*subApis.Subscription, error)
GetSubscriptionsForEventActivation() gets all the subscriptions having the same "namespace" and the same "Source" as the "ea" object
func RemoveString ¶
func UpdateEventActivation ¶
func UpdateEventActivation(ctx context.Context, client runtimeClient.Client, u *eventingv1alpha1.EventActivation) error
func UpdateSubscriptionReadyStatus ¶
func UpdateSubscriptionReadyStatus(sub *subApis.Subscription, conditionStatus subApis.ConditionStatus, msg string) *subApis.Subscription
func UpdateSubscriptionsEventActivatedStatus ¶
func UpdateSubscriptionsEventActivatedStatus(subs []*subApis.Subscription, conditionStatus subApis.ConditionStatus) []*subApis.Subscription
func WriteSubscription ¶
func WriteSubscription(ctx context.Context, client runtimeClient.Client, sub *subApis.Subscription) error
Types ¶
type KnativeLib ¶
type KnativeLib struct {
// contains filtered or unexported fields
}
func GetKnativeLib ¶
func GetKnativeLib() (*KnativeLib, error)
GetKnativeLib returns the Knative/Eventing access layer
func (*KnativeLib) CreateChannel ¶
func (k *KnativeLib) CreateChannel(provisioner string, name string, namespace string, timeout time.Duration) (*evapisv1alpha1.Channel, error)
CreateChannel creates a Knative/Eventing channel controlled by the specified provisioner
func (*KnativeLib) CreateSubscription ¶
func (k *KnativeLib) CreateSubscription(name string, namespace string, channelName string, uri *string) error
CreateSubscription creates a Knative/Eventing subscription for the specified channel
func (*KnativeLib) DeleteChannel ¶
func (k *KnativeLib) DeleteChannel(name string, namespace string) error
DeleteChannel deletes a Knative/Eventing channel
func (*KnativeLib) DeleteSubscription ¶
func (k *KnativeLib) DeleteSubscription(name string, namespace string) error
DeleteSubscription deletes a Knative/Eventing subscription
func (*KnativeLib) GetChannel ¶
func (k *KnativeLib) GetChannel(name string, namespace string) (*evapisv1alpha1.Channel, error)
GetChannel returns an existing Knative/Eventing channel, if it exists. If the channel doesn't exist, the error returned can be checked using the standard K8S function: "k8serrors.IsNotFound(err) "
func (*KnativeLib) GetSubscription ¶
func (k *KnativeLib) GetSubscription(name string, namespace string) (*evapisv1alpha1.Subscription, error)
GetSubscription gets a Knative/Eventing subscription
func (*KnativeLib) InjectClient ¶
func (r *KnativeLib) InjectClient(c eventingv1alpha1.EventingV1alpha1Interface) error
InjectClient injects a client, useful for running tests.
func (*KnativeLib) SendMessage ¶
func (k *KnativeLib) SendMessage(channel *evapisv1alpha1.Channel, message *string) error
SendMessage sends a message to a channel
func (*KnativeLib) UpdateSubscription ¶
func (k *KnativeLib) UpdateSubscription(sub *evapisv1alpha1.Subscription) (*evapisv1alpha1.Subscription, error)
UpdateSubscription updates an existing subscription
type SubscriptionBuilder ¶
type SubscriptionBuilder struct {
*eventingv1alpha1.Subscription
}
func Subscription ¶
func Subscription(name string, namespace string) *SubscriptionBuilder
func (*SubscriptionBuilder) Build ¶
func (s *SubscriptionBuilder) Build() *eventingv1alpha1.Subscription
func (*SubscriptionBuilder) EmptyReply ¶
func (s *SubscriptionBuilder) EmptyReply() *SubscriptionBuilder
func (*SubscriptionBuilder) ToChannel ¶
func (s *SubscriptionBuilder) ToChannel(name string) *SubscriptionBuilder
func (*SubscriptionBuilder) ToK8sService ¶
func (s *SubscriptionBuilder) ToK8sService(k8sServiceName string) *SubscriptionBuilder
func (*SubscriptionBuilder) ToKNService ¶
func (s *SubscriptionBuilder) ToKNService(knServiceName string) *SubscriptionBuilder
func (*SubscriptionBuilder) ToUri ¶
func (s *SubscriptionBuilder) ToUri(uri *string) *SubscriptionBuilder
type SubscriptionWithError ¶
type SubscriptionWithError struct { Sub *subApis.Subscription Err error }
func WriteSubscriptions ¶
func WriteSubscriptions(ctx context.Context, client runtimeClient.Client, subs []*subApis.Subscription) []SubscriptionWithError