Documentation ¶
Index ¶
- Constants
- func Broker(name string, options ...BrokerOption) *eventingv1alpha1.Broker
- func ClusterRoleBinding(saName, saNamespace, crName, crbName string) *rbacv1.ClusterRoleBinding
- func EventDetailsPod(name string) *corev1.Pod
- func EventFilteringPod(name string, filter bool) *corev1.Pod
- func EventLatencyPod(name, sink string, eventCount int) *corev1.Pod
- func EventLoggerPod(name string) *corev1.Pod
- func EventSenderPod(name string, sink string, event *CloudEvent) (*corev1.Pod, error)
- func EventSenderTracingPod(name string, sink string, event *CloudEvent) (*corev1.Pod, error)
- func EventTransformationPod(name string, event *CloudEvent) *corev1.Pod
- func HelloWorldPod(name string, options ...PodOption) *corev1.Pod
- func Role(rName string, options ...RoleOption) *rbacv1.Role
- func RoleBinding(saName, saNamespace, rKind, rName, rbName, rbNamespace string) *rbacv1.RoleBinding
- func SequenceStepperPod(name, eventMsgAppender string) *corev1.Pod
- func Service(name string, selector map[string]string) *corev1.Service
- func ServiceAccount(name, namespace string) *corev1.ServiceAccount
- func ServiceRef(name string) *corev1.ObjectReference
- func Subscription(name, channelName string, channelTypeMeta *metav1.TypeMeta, ...) *messagingv1alpha1.Subscription
- func Trigger(name string, options ...TriggerOption) *eventingv1alpha1.Trigger
- type BrokerOption
- type CloudEvent
- type CloudEventBaseData
- type MetaResource
- type MetaResourceList
- type PodOption
- type RoleOption
- type SubscriptionOption
- type TriggerOption
- func WithAttributesTriggerFilter(eventSource, eventType string, extensions map[string]interface{}) TriggerOption
- func WithBroker(brokerName string) TriggerOption
- func WithDeprecatedSourceAndTypeTriggerFilter(eventSource, eventType string) TriggerOption
- func WithSubscriberRefForTrigger(name string) TriggerOption
- func WithSubscriberURIForTrigger(uri string) TriggerOption
Constants ¶
const ( CloudEventEncodingBinary = "binary" CloudEventEncodingStructured = "structured" CloudEventDefaultEncoding = CloudEventEncodingBinary CloudEventDefaultType = "dev.knative.test.event" )
CloudEvent related constants.
const ( CoreAPIVersion = "v1" EventingAPIVersion = "eventing.knative.dev/v1alpha1" SourcesAPIVersion = "sources.eventing.knative.dev/v1alpha1" MessagingAPIVersion = "messaging.knative.dev/v1alpha1" )
API versions for the resources.
const ( SubscriptionKind string = "Subscription" BrokerKind string = "Broker" TriggerKind string = "Trigger" )
Kind for eventing resources.
const ( InMemoryChannelKind string = "InMemoryChannel" ChannelKind string = "Channel" SequenceKind string = "Sequence" ParallelKind string = "Parallel" )
Kind for messaging resources.
const ( CronJobSourceKind string = "CronJobSource" ContainerSourceKind string = "ContainerSource" ApiServerSourceKind string = "ApiServerSource" )
Kind for sources resources.
const (
ServiceKind string = "Service"
)
Kind for core Kubernetes resources.
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 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 EventDetailsPod ¶ added in v0.9.0
EventDetailsPod creates a Pod that validates events received and log details about events.
func EventFilteringPod ¶ added in v0.8.0
EventFilteringPod creates a Pod that either filter or send the received CloudEvent
func EventLatencyPod ¶
EventLatencyPod creates a Pod that measures events transfer latency.
func EventLoggerPod ¶
EventLoggerPod creates a Pod that logs events received.
func EventSenderPod ¶
EventSenderPod creates a Pod that sends a single event to the given address.
func EventSenderTracingPod ¶ added in v0.9.0
EventSenderTracingPod creates a Pod that sends a single event to the given address.
func EventTransformationPod ¶
func EventTransformationPod(name string, event *CloudEvent) *corev1.Pod
EventTransformationPod creates a Pod that transforms events received.
func HelloWorldPod ¶
HelloWorldPod creates a Pod that logs "Hello, World!".
func Role ¶ added in v0.10.0
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 ¶ added in v0.8.0
SequenceStepperPod creates a Pod that can be used as a step in testing Sequence. Note event data used in the test must be CloudEventBaseData, and this Pod as a Subscriber will receive the event, and return a new event with eventMsgAppender added to data.Message.
func Service ¶
Service creates a Kubernetes Service with the given name, namespace, and selector. Port 8080 is set as the target port.
func ServiceAccount ¶
func ServiceAccount(name, namespace string) *corev1.ServiceAccount
ServiceAccount creates a Kubernetes ServiceAccount with the given name and namespace.
func ServiceRef ¶ added in v0.8.0
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 Trigger ¶
func Trigger(name string, options ...TriggerOption) *eventingv1alpha1.Trigger
Trigger returns a 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.
type CloudEvent ¶
type CloudEvent struct { ID string Type string Source string Extensions map[string]interface{} Data string // must be in json format Encoding string // binary or structured }
CloudEvent specifies the arguments for a CloudEvent used by the sendevents or transformevents image.
type CloudEventBaseData ¶ added in v0.8.0
CloudEventBaseData defines a simple struct that can be used as data of a CloudEvent.
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 ¶
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 ¶ added in v0.9.0
PodOption enables further configuration of a Pod.
func WithLabelsForPod ¶ added in v0.9.0
WithLabelsForPod returns an option setting the pod labels
type RoleOption ¶ added in v0.10.0
Option enables further configuration of a Role.
func WithRuleForRole ¶ added in v0.10.0
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 WithReplyForSubscription ¶ added in v0.8.0
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 TriggerOption ¶
type TriggerOption func(*eventingv1alpha1.Trigger)
TriggerOption enables further configuration of a Trigger.
func WithAttributesTriggerFilter ¶ added in v0.9.0
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 WithDeprecatedSourceAndTypeTriggerFilter ¶ added in v0.9.0
func WithDeprecatedSourceAndTypeTriggerFilter(eventSource, eventType string) TriggerOption
WithDeprecatedSourceAndTypeTriggerFilter returns an option that adds a TriggerFilter with DeprecatedSourceAndType for the given Trigger.
func WithSubscriberRefForTrigger ¶
func WithSubscriberRefForTrigger(name string) TriggerOption
WithSubscriberRefForTrigger returns an option that adds a Subscriber 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.