resources

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudEventEncodingBinary     = "binary"
	CloudEventEncodingStructured = "structured"
	CloudEventDefaultEncoding    = CloudEventEncodingBinary
	CloudEventDefaultType        = "dev.knative.test.event"
)

CloudEvent related constants.

View Source
const (
	// InMemoryProvisioner is the in-memory provisioner, which is also the default one.
	InMemoryProvisioner = "in-memory"
	// GCPPubSubProvisioner is the gcp-pubsub provisioner, which is under contrib/gcppubsub.
	GCPPubSubProvisioner = "gcp-pubsub"
	// KafkaProvisioner is the kafka provisioner, which is under contrib/kafka.
	KafkaProvisioner = "kafka"
	// NatssProvisioner is the natss provisioner, which is under contrib/natss
	NatssProvisioner = "natss"
)
View Source
const (
	CoreAPIVersion      = "v1"
	EventingAPIVersion  = "eventing.knative.dev/v1alpha1"
	SourcesAPIVersion   = "sources.eventing.knative.dev/v1alpha1"
	MessagingAPIVersion = "messaging.knative.dev/v1alpha1"
)

API versions for the resources.

View Source
const (
	ChannelKind                   string = "Channel"
	SubscriptionKind              string = "Subscription"
	ClusterChannelProvisionerKind string = "ClusterChannelProvisioner"

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

Kind for eventing resources.

View Source
const (
	InMemoryChannelKind string = "InMemoryChannel"
	KafkaChannelKind    string = "KafkaChannel"
	NatssChannelKind    string = "NatssChannel"
)

Kind for messaging resources.

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

Kind for sources 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 ApiServerSource

func ApiServerSource(
	name string,
	resources []sourcesv1alpha1.ApiServerResource,
	mode string,
	options ...ApiServerSourceOption,
) *sourcesv1alpha1.ApiServerSource

ApiServerSource returns an ApiServer EventSource.

func Broker

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

Broker returns a Broker.

func Channel

func Channel(name, provisioner string) *eventingv1alpha1.Channel

Channel returns a Channel with the specified provisioner.

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 ContainerSource

func ContainerSource(
	name string,
	options ...ContainerSourceOption,
) *sourcesv1alpha1.ContainerSource

ContainerSource returns a Container EventSource.

func ContainerSourceBasicTemplate

func ContainerSourceBasicTemplate(
	name,
	namespace,
	imageName string,
	args []string,
) *corev1.PodTemplateSpec

ContainerSourceBasicTemplate returns a basic template that can be used in ContainerSource.

func CronJobSource

func CronJobSource(
	name,
	schedule,
	data string,
	options ...CronJobSourceOption,
) *sourcesv1alpha1.CronJobSource

CronJobSource returns a CronJob EventSource.

func EventLatencyPod

func EventLatencyPod(name, sink string, eventCount int) *corev1.Pod

EventLatencyPod creates a Pod that measures events transfer latency.

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 *CloudEvent) *corev1.Pod

EventSenderPod 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 EventWatcherClusterRole

func EventWatcherClusterRole(crName string) *rbacv1.ClusterRole

EventWatcherClusterRole creates a Kubernetes ClusterRole that can be used to watch Events.

func HelloWorldPod

func HelloWorldPod(name string) *corev1.Pod

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

func InMemoryChannel

func InMemoryChannel(name string) *messagingv1alpha1.InMemoryChannel

InMemoryChannel returns an InMemoryChannel resource.

func KafkaChannel

func KafkaChannel(name string) *kafkamessagingv1alpha1.KafkaChannel

KafkaChannel returns a KafkaChannel resource.

func NatssChannel

func NatssChannel(name string) *natssmessagingv1alpha1.NatssChannel

NatssChannel returns an NatssChannel resource.

func RoleBinding

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

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

func Service

func Service(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 ServiceAccount

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

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

func Subscription

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

Subscription returns a Subscription.

func Trigger

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

Trigger returns a Trigger.

Types

type ApiServerSourceOption

type ApiServerSourceOption func(*sourcesv1alpha1.ApiServerSource)

ApiServerSourceOption enables further configuration of an ApiServerSource.

func WithServiceAccountForApiServerSource

func WithServiceAccountForApiServerSource(saName string) ApiServerSourceOption

WithServiceAccountForApiServerSource returns an option that adds a ServiceAccount for the given ApiServerSource.

func WithSinkServiceForApiServerSource

func WithSinkServiceForApiServerSource(name string) ApiServerSourceOption

WithSinkServiceForApiServerSource returns an option that adds a Kubernetes Service sink for the given ApiServerSource.

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 WithDeprecatedChannelTemplateForBroker

func WithDeprecatedChannelTemplateForBroker(provisionerName string) BrokerOption

WithDeprecatedChannelTemplateForBroker returns a function that adds a DeprecatedChannelTemplate for the given Broker.

type CloudEvent

type CloudEvent struct {
	ID       string
	Type     string
	Source   string
	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 ContainerSourceOption

type ContainerSourceOption func(*sourcesv1alpha1.ContainerSource)

ContainerSourceOption enables further configuration of a ContainerSource.

func WithSinkServiceForContainerSource

func WithSinkServiceForContainerSource(name string) ContainerSourceOption

WithSinkServiceForContainerSource returns an option that adds a Kubernetes Service sink for the given ContainerSource.

func WithTemplateForContainerSource

func WithTemplateForContainerSource(template *corev1.PodTemplateSpec) ContainerSourceOption

WithTemplateForContainerSource returns an option that adds a template for the given ContainerSource.

type CronJobSourceOption

type CronJobSourceOption func(*sourcesv1alpha1.CronJobSource)

CronJobSourceOption enables further configuration of a CronJobSource.

func WithServiceAccountForCronJobSource

func WithServiceAccountForCronJobSource(saName string) CronJobSourceOption

WithServiceAccountForCronJobSource returns an option that adds a ServiceAccount for the given CronJobSource.

func WithSinkServiceForCronJobSource

func WithSinkServiceForCronJobSource(name string) CronJobSourceOption

WithSinkServiceForCronJobSource returns an option that adds a Kubernetes Service sink for the given CronJobSource.

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 SubscriptionOption

type SubscriptionOption func(*eventingv1alpha1.Subscription)

SubscriptionOption enables further configuration of a Subscription.

func WithReply

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

WithReply 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 WithBroker

func WithBroker(brokerName string) TriggerOption

WithBroker returns an option that adds a Broker 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.

func WithTriggerFilter

func WithTriggerFilter(eventSource, eventType string) TriggerOption

WithTriggerFilter returns an option that adds a TriggerFilter for the given Trigger.

Jump to

Keyboard shortcuts

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