Documentation ¶
Index ¶
Constants ¶
const ( EventSourceControlledLabel = "controlled-by-eventsource" TriggerControlledLabel = "controlled-by-trigger" EventBusNameLabel = "eventbus-name" EventBusTopicName = "eventbus-topic-name" DefaultLogLevel = "1" // EventSourceComponentNameTmpl => esc(EventSource Component)-{sourceKind}-{eventName} EventSourceComponentNameTmpl = "esc-%s-%s" // EventSourceBusComponentNameTmpl => ebfes(EventBus for EventSource)-{eventSourceName} EventSourceBusComponentNameTmpl = "ebfes-%s" // TriggerBusComponentNameTmpl => ebft(EventBus for Trigger)-{triggerName} TriggerBusComponentNameTmpl = "ebft-%s" // SinkComponentNameTmpl => ts-{resourceName}-{sinkNamespace} SinkComponentNameTmpl = "ts-%s-%s" // EventSourceWorkloadsNameTmpl => esw(EventSource Workloads)-{eventSourceName}-{sourceKind}-{eventName} EventSourceWorkloadsNameTmpl = "esw-%s-%s-%s" // TriggerWorkloadsNameTmpl => t(Trigger)-{triggerName} TriggerWorkloadsNameTmpl = "t-%s" // EventBusTopicNameTmpl => {namespace}-{eventSourceName}-{eventName} EventBusTopicNameTmpl = "%s-%s-%s" // EventBusOutputNameTmpl => ebo(EventBus output)-{topicName} EventBusOutputNameTmpl = "ebo-%s" // SinkOutputNameTmpl => so(Sink output)-{resourceType}-{resourceName}-{index} SinkOutputNameTmpl = "so-%s-%s-%s" // EventSourceInputNameTmpl => esi(EventSource input)-{eventName} EventSourceInputNameTmpl = "esi-%s" // TriggerInputNameTmpl => ti(Trigger input)-{topicName} TriggerInputNameTmpl = "ti-%s" // SourceKindKafka indicates kafka event source SourceKindKafka = "kafka" // SourceKindCron indicates cron (scheduler) event source SourceKindCron = "cron" // SourceKindMQTT indicates mqtt event source SourceKindMQTT = "mqtt" // SourceKindRedis indicates redis event source SourceKindRedis = "redis" )
Variables ¶
This section is empty.
Functions ¶
func InitFunction ¶
Types ¶
type EventSourceConfig ¶
type EventSourceConfig struct { EventBusComponent string `json:"eventBusComponent,omitempty"` EventBusOutputName string `json:"eventBusOutputName,omitempty"` EventBusTopic string `json:"eventBusTopic,omitempty"` SinkOutputName string `json:"sinkOutputName,omitempty"` LogLevel string `json:"logLevel,omitempty"` }
func (*EventSourceConfig) DecodeEnv ¶
func (e *EventSourceConfig) DecodeEnv(encodedConfig string) (*EventSourceConfig, error)
func (*EventSourceConfig) EncodeConfig ¶
func (e *EventSourceConfig) EncodeConfig() (string, error)
type EventSourceReconciler ¶
type EventSourceReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme EventSourceConfig *EventSourceConfig Function *ofcore.Function // contains filtered or unexported fields }
EventSourceReconciler reconciles a EventSource object
func (*EventSourceReconciler) Reconcile ¶
func (r *EventSourceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the EventSource object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*EventSourceReconciler) SetupWithManager ¶
func (r *EventSourceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type Subscriber ¶
type Subscribers ¶
type Subscribers struct { Sinks []*ofevent.SinkSpec `json:"sinks,omitempty"` DeadLetterSinks []*ofevent.SinkSpec `json:"deadLetterSinks,omitempty"` TotalSinks []*ofevent.SinkSpec `json:"totalSinks,omitempty"` Topics []string `json:"topics,omitempty"` DeadLetterTopics []string `json:"deadLetterTopics,omitempty"` TotalTopics []string `json:"totalTopics,omitempty"` }
type TriggerConfig ¶
type TriggerConfig struct { EventBusComponent string `json:"eventBusComponent,omitempty"` Inputs []*Input `json:"inputs,omitempty"` Subscribers map[string]*Subscriber `json:"subscribers,omitempty"` LogLevel string `json:"logLevel,omitempty"` }
func (*TriggerConfig) DecodeEnv ¶
func (e *TriggerConfig) DecodeEnv(encodedConfig string) (*TriggerConfig, error)
func (*TriggerConfig) EncodeConfig ¶
func (e *TriggerConfig) EncodeConfig() (string, error)
type TriggerReconciler ¶
type TriggerReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme TriggerConfig *TriggerConfig Function *ofcore.Function // contains filtered or unexported fields }
TriggerReconciler reconciles a Trigger object
func (*TriggerReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the Trigger object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile
func (*TriggerReconciler) SetupWithManager ¶
func (r *TriggerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.