resources

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoreAPIVersion          = "v1"
	EventingAPIVersion      = "eventing.knative.dev/v1alpha1"
	LegacySourcesAPIVersion = "sources.eventing.knative.dev/v1alpha1"
	MessagingAPIVersion     = "messaging.knative.dev/v1alpha1"
	FlowsAPIVersion         = "flows.knative.dev/v1alpha1"
	ServingAPIVersion       = "serving.knative.dev/v1"
)

API versions for the resources.

View Source
const (
	SubscriptionKind string = "Subscription"

	BrokerKind  string = "Broker"
	TriggerKind string = "Trigger"
)

Kind for eventing resources.

View Source
const (
	InMemoryChannelKind string = "InMemoryChannel"

	ChannelKind  string = "Channel"
	SequenceKind string = "Sequence"
	ParallelKind string = "Parallel"
)

Kind for messaging resources.

View Source
const (
	FlowsSequenceKind string = "Sequence"
	FlowsParallelKind string = "Parallel"
)

Kind for flows resources.

View Source
const (
	CronJobSourceKind   string = "CronJobSource"
	ContainerSourceKind string = "ContainerSource"
	ApiServerSourceKind string = "ApiServerSource"
)

Kind for sources resources.

View Source
const (
	PerfConsumerService   = "perf-consumer"
	PerfAggregatorService = "perf-aggregator"
	PerfServiceAccount    = "perf-eventing"
)
View Source
const (
	KServiceKind string = "Service"
)

Kind for Knative resources.

View Source
const (
	ServiceKind string = "Service"
)

Kind for core Kubernetes resources.

View Source
const SystemNamespace = "knative-eventing"

SystemNamespace is the namespace where Eventing is installed, it's default to be knative-eventing.

Variables

This section is empty.

Functions

func Broker

func Broker(name string, options ...BrokerOption) *eventingv1alpha1.Broker

Broker returns a Broker.

func BrokerV1Beta1 added in v0.13.0

func BrokerV1Beta1(name string, options ...BrokerV1Beta1Option) *eventingv1beta1.Broker

Broker returns a Broker.

func ClusterRoleBinding

func ClusterRoleBinding(saName, saNamespace, crName, crbName string) *rbacv1.ClusterRoleBinding

ClusterRoleBinding creates a Kubernetes ClusterRoleBinding with the given ServiceAccount name and namespace, ClusterRole name, ClusterRoleBinding name.

func ConfigMap added in v0.13.0

func ConfigMap(name string, data map[string]string) *corev1.ConfigMap

ConfigMap returns a ConfigMap.

func ConfigMapPropagation added in v0.13.0

func ConfigMapPropagation(name, namespace string) *configsv1alpha1.ConfigMapPropagation

ConfigMapPropagation returns a ConfigMapPropagation.

func Delivery

func Delivery(options ...DeliveryOption) *eventingduckv1beta1.DeliverySpec

Delivery returns a DeliverySpec.

func EventDetailsPod

func EventDetailsPod(name string) *corev1.Pod

EventDetailsPod creates a Pod that validates events received and log details about events.

func EventFilteringPod

func EventFilteringPod(name string, filter bool) *corev1.Pod

EventFilteringPod creates a Pod that either filter or send the received CloudEvent

func EventLoggerPod

func EventLoggerPod(name string) *corev1.Pod

EventLoggerPod creates a Pod that logs events received.

func EventSenderPod

func EventSenderPod(name string, sink string, event *cloudevents.CloudEvent) (*corev1.Pod, error)

EventSenderPod creates a Pod that sends a single event to the given address.

func EventSenderTracingPod

func EventSenderTracingPod(name string, sink string, event *cloudevents.CloudEvent) (*corev1.Pod, error)

EventSenderTracingPod creates a Pod that sends a single event to the given address.

func EventTransformationPod

func EventTransformationPod(name string, event *cloudevents.CloudEvent) *corev1.Pod

EventTransformationPod creates a Pod that transforms events received.

func HelloWorldPod

func HelloWorldPod(name string, options ...PodOption) *corev1.Pod

HelloWorldPod creates a Pod that logs "Hello, World!".

func KServiceRef

func KServiceRef(name string) *corev1.ObjectReference

KServiceRef returns a Knative Service ObjectReference for a given Service name.

func KnativeRefForService added in v0.13.0

func KnativeRefForService(name, namespace string) *duckv1.KReference

func PerformanceAggregatorService

func PerformanceAggregatorService() *corev1.Service

func PerformanceConsumerService

func PerformanceConsumerService() *corev1.Service

func PerformanceImageAggregatorPod

func PerformanceImageAggregatorPod(expectedRecords int, publish bool, additionalArgs ...string) *corev1.Pod

func PerformanceImageReceiverPod

func PerformanceImageReceiverPod(imageName string, pace string, warmup string, aggregatorHostname string, additionalArgs ...string) *corev1.Pod

func Role

func Role(rName string, options ...RoleOption) *rbacv1.Role

EventWatcherRole creates a Kubernetes Role

func RoleBinding

func RoleBinding(saName, saNamespace, rKind, rName, rbName, rbNamespace string) *rbacv1.RoleBinding

RoleBinding creates a Kubernetes RoleBinding with the given ServiceAccount name and namespace, Role or ClusterRole Kind, name, RoleBinding name and namespace.

func SequenceStepperPod

func SequenceStepperPod(name, eventMsgAppender string) *corev1.Pod

SequenceStepperPod creates a Pod that can be used as a step in testing Sequence. Note event data used in the test must be BaseData, and this Pod as a Subscriber will receive the event, and return a new event with eventMsgAppender added to data.Message.

func Service

func Service(name string, selector map[string]string, ports []corev1.ServicePort) *corev1.Service

Service creates a Kubernetes Service with the given name, selector and ports

func ServiceAccount

func ServiceAccount(name, namespace string) *corev1.ServiceAccount

ServiceAccount creates a Kubernetes ServiceAccount with the given name and namespace.

func ServiceDefaultHTTP

func ServiceDefaultHTTP(name string, selector map[string]string) *corev1.Service

Service creates a Kubernetes Service with the given name, namespace, and selector. Port 8080 is set as the target port.

func ServiceRef

func ServiceRef(name string) *corev1.ObjectReference

ServiceRef returns a Service ObjectReference for a given Service name.

func Subscription

func Subscription(
	name, channelName string,
	channelTypeMeta *metav1.TypeMeta,
	options ...SubscriptionOption,
) *messagingv1alpha1.Subscription

Subscription returns a Subscription.

func SubscriptionV1Beta1 added in v0.13.0

func SubscriptionV1Beta1(
	name, channelName string,
	channelTypeMeta *metav1.TypeMeta,
	options ...SubscriptionOptionV1Beta1,
) *messagingv1beta1.Subscription

SubscriptionV1Beta1 returns a v1beta1 Subscription.

func Trigger

func Trigger(name string, options ...TriggerOption) *eventingv1alpha1.Trigger

Trigger returns a Trigger.

func TriggerV1Beta1 added in v0.13.0

func TriggerV1Beta1(name string, options ...TriggerOptionV1Beta1) *eventingv1beta1.Trigger

TriggerV1Beta1 returns a v1beta1 Trigger.

Types

type BrokerOption

type BrokerOption func(*eventingv1alpha1.Broker)

BrokerOption enables further configuration of a Broker.

func WithChannelTemplateForBroker

func WithChannelTemplateForBroker(channelTypeMeta *metav1.TypeMeta) BrokerOption

WithChannelTemplateForBroker returns a function that adds a ChannelTemplate for the given Broker.

func WithDeliveryForBroker

func WithDeliveryForBroker(delivery *eventingduckv1beta1.DeliverySpec) BrokerOption

WithDeliveryForBroker returns a function that adds a Delivery for the given Broker.

type BrokerV1Beta1Option added in v0.13.0

type BrokerV1Beta1Option func(*eventingv1beta1.Broker)

BrokerV1Beta1Option enables further configuration of a Broker.

func WithChannelTemplateForBrokerV1Beta1 added in v0.13.0

func WithChannelTemplateForBrokerV1Beta1(config *duckv1.KReference) BrokerV1Beta1Option

WithChannelTemplateForBrokerV1Beta1 returns a function that adds a Config to the given Broker.

type DeliveryOption

type DeliveryOption func(*eventingduckv1beta1.DeliverySpec)

DeliveryOption enables further configuration of DeliverySpec.

func WithDeadLetterSinkForDelivery

func WithDeadLetterSinkForDelivery(name string) DeliveryOption

WithDeadLetterSinkForDelivery returns an options that adds a DeadLetterSink for the given DeliverySpec.

type MetaResource

type MetaResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
}

MetaResource includes necessary meta data to retrieve the generic Kubernetes resource.

func NewMetaResource

func NewMetaResource(name, namespace string, typemeta *metav1.TypeMeta) *MetaResource

NewMetaResource returns a MetaResource built from the given name, namespace and typemeta.

type MetaResourceList

type MetaResourceList struct {
	metav1.TypeMeta `json:",inline"`
	Namespace       string
}

MetaResourceList includes necessary meta data to retrieve the generic Kubernetes resource list.

func NewMetaResourceList

func NewMetaResourceList(namespace string, typemeta *metav1.TypeMeta) *MetaResourceList

NewMetaResourceList returns a MetaResourceList built from the given namespace and typemeta.

type PodOption

type PodOption func(*corev1.Pod)

PodOption enables further configuration of a Pod.

func WithLabelsForPod

func WithLabelsForPod(labels map[string]string) PodOption

WithLabelsForPod returns an option setting the pod labels

type RoleOption

type RoleOption func(*rbacv1.Role)

Option enables further configuration of a Role.

func WithRuleForRole

func WithRuleForRole(rule *rbacv1.PolicyRule) RoleOption

WithRuleForRole is a Role Option for adding a rule

type SubscriptionOption

type SubscriptionOption func(*messagingv1alpha1.Subscription)

SubscriptionOption enables further configuration of a Subscription.

func WithDeadLetterSinkForSubscription

func WithDeadLetterSinkForSubscription(name string) SubscriptionOption

WithDeadLetterSinkForSubscription returns an options that adds a DeadLetterSink for the given Subscription.

func WithReplyForSubscription

func WithReplyForSubscription(name string, typemeta *metav1.TypeMeta) SubscriptionOption

WithReplyForSubscription returns an options that adds a ReplyStrategy for the given Subscription.

func WithSubscriberForSubscription

func WithSubscriberForSubscription(name string) SubscriptionOption

WithSubscriberForSubscription returns an option that adds a Subscriber for the given Subscription.

type SubscriptionOptionV1Beta1 added in v0.13.0

type SubscriptionOptionV1Beta1 func(*messagingv1beta1.Subscription)

SubscriptionOptionV1Beta1 enables further configuration of a Subscription.

func WithSubscriberForSubscriptionV1Beta1 added in v0.13.0

func WithSubscriberForSubscriptionV1Beta1(name string) SubscriptionOptionV1Beta1

WithSubscriberForSubscriptionV1Beta1 returns an option that adds a Subscriber for the given v1beta1 Subscription.

type TriggerOption

type TriggerOption func(*eventingv1alpha1.Trigger)

TriggerOption enables further configuration of a Trigger.

func WithAttributesTriggerFilter

func WithAttributesTriggerFilter(eventSource, eventType string, extensions map[string]interface{}) TriggerOption

WithAttributesTriggerFilter returns an option that adds a TriggerFilter with Attributes for the given Trigger.

func WithBroker

func WithBroker(brokerName string) TriggerOption

WithBroker returns an option that adds a Broker for the given Trigger.

func WithDependencyAnnotationTrigger added in v0.13.1

func WithDependencyAnnotationTrigger(dependencyAnnotation string) TriggerOption

WithDependencyAnnotationTrigger returns an option that adds a dependency annotation to the given Trigger.

func WithDeprecatedSourceAndTypeTriggerFilter

func WithDeprecatedSourceAndTypeTriggerFilter(eventSource, eventType string) TriggerOption

WithDeprecatedSourceAndTypeTriggerFilter returns an option that adds a TriggerFilter with DeprecatedSourceAndType for the given Trigger.

func WithSubscriberKServiceRefForTrigger

func WithSubscriberKServiceRefForTrigger(name string) TriggerOption

WithSubscriberKServiceRefForTrigger returns an option that adds a Subscriber Knative Service Ref for the given Trigger.

func WithSubscriberServiceRefForTrigger

func WithSubscriberServiceRefForTrigger(name string) TriggerOption

WithSubscriberServiceRefForTrigger returns an option that adds a Subscriber Kubernetes Service Ref for the given Trigger.

func WithSubscriberURIForTrigger

func WithSubscriberURIForTrigger(uri string) TriggerOption

WithSubscriberURIForTrigger returns an option that adds a Subscriber URI for the given Trigger.

type TriggerOptionV1Beta1 added in v0.13.0

type TriggerOptionV1Beta1 func(*eventingv1beta1.Trigger)

TriggerOptionV1Beta1 enables further configuration of a v1beta1 Trigger.

func WithAttributesTriggerFilterV1Beta1 added in v0.13.0

func WithAttributesTriggerFilterV1Beta1(eventSource, eventType string, extensions map[string]interface{}) TriggerOptionV1Beta1

WithAttributesTriggerFilter returns an option that adds a TriggerFilter with Attributes for the given Trigger.

func WithDependencyAnnotationTriggerV1Beta1 added in v0.13.1

func WithDependencyAnnotationTriggerV1Beta1(dependencyAnnotation string) TriggerOptionV1Beta1

WithDependencyAnnotationTrigger returns an option that adds a dependency annotation to the given Trigger.

func WithSubscriberServiceRefForTriggerV1Beta1 added in v0.13.0

func WithSubscriberServiceRefForTriggerV1Beta1(name string) TriggerOptionV1Beta1

WithSubscriberServiceRefForTriggerV1Beta1 returns an option that adds a Subscriber Knative Service Ref for the given Trigger.

Jump to

Keyboard shortcuts

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