Documentation
¶
Index ¶
- type EngineDataSourceFactory
- func (c *EngineDataSourceFactory) GetFieldName() string
- func (c *EngineDataSourceFactory) ResolveDataSource() (resolve.DataSource, error)
- func (c *EngineDataSourceFactory) ResolveDataSourceInput(eventData []byte) (string, error)
- func (c *EngineDataSourceFactory) ResolveDataSourceSubscription() (datasource.SubscriptionDataSource, error)
- func (c *EngineDataSourceFactory) ResolveDataSourceSubscriptionInput() (string, error)
- func (c *EngineDataSourceFactory) TransformEventData(extractFn datasource.ArgumentTemplateCallback) error
- type Event
- type EventType
- type MutableEvent
- type PollerOpts
- type ProviderAdapter
- func (p *ProviderAdapter) Publish(ctx context.Context, conf datasource.PublishEventConfiguration, ...) error
- func (p *ProviderAdapter) Shutdown(ctx context.Context) error
- func (p *ProviderAdapter) Startup(ctx context.Context) (err error)
- func (p *ProviderAdapter) Subscribe(ctx context.Context, conf datasource.SubscriptionEventConfiguration, ...) error
- type ProviderBuilder
- func (p *ProviderBuilder) BuildEngineDataSourceFactory(data *nodev1.KafkaEventConfiguration, providers map[string]datasource.Provider) (datasource.EngineDataSourceFactory, error)
- func (p *ProviderBuilder) BuildProvider(provider config.KafkaEventSource, providerOpts datasource.ProviderOpts) (datasource.Provider, error)
- func (p *ProviderBuilder) TypeID() string
- type PublishDataSource
- type PublishEventConfiguration
- type SubscriptionDataSource
- type SubscriptionEventConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineDataSourceFactory ¶
type EngineDataSourceFactory struct {
KafkaAdapter datasource.Adapter
// contains filtered or unexported fields
}
func (*EngineDataSourceFactory) GetFieldName ¶
func (c *EngineDataSourceFactory) GetFieldName() string
func (*EngineDataSourceFactory) ResolveDataSource ¶
func (c *EngineDataSourceFactory) ResolveDataSource() (resolve.DataSource, error)
func (*EngineDataSourceFactory) ResolveDataSourceInput ¶
func (c *EngineDataSourceFactory) ResolveDataSourceInput(eventData []byte) (string, error)
func (*EngineDataSourceFactory) ResolveDataSourceSubscription ¶
func (c *EngineDataSourceFactory) ResolveDataSourceSubscription() (datasource.SubscriptionDataSource, error)
func (*EngineDataSourceFactory) ResolveDataSourceSubscriptionInput ¶
func (c *EngineDataSourceFactory) ResolveDataSourceSubscriptionInput() (string, error)
func (*EngineDataSourceFactory) TransformEventData ¶
func (c *EngineDataSourceFactory) TransformEventData(extractFn datasource.ArgumentTemplateCallback) error
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event implements datasource.StreamEvent
func (Event) Clone ¶
func (e Event) Clone() datasource.MutableStreamEvent
func (*Event) GetHeaders ¶
type MutableEvent ¶
type MutableEvent struct {
Key []byte `json:"key"`
Data json.RawMessage `json:"data"`
Headers map[string][]byte `json:"headers"`
}
MutableEvent implements datasource.MutableEvent
func (*MutableEvent) Clone ¶
func (e *MutableEvent) Clone() datasource.MutableStreamEvent
func (*MutableEvent) GetData ¶
func (e *MutableEvent) GetData() []byte
func (*MutableEvent) SetData ¶
func (e *MutableEvent) SetData(data []byte)
type PollerOpts ¶
type PollerOpts struct {
// contains filtered or unexported fields
}
type ProviderAdapter ¶
type ProviderAdapter struct {
// contains filtered or unexported fields
}
ProviderAdapter is a Kafka pubsub implementation. It uses the franz-go Kafka client to consume and produce messages. The pubsub is stateless and does not store any messages. It uses a single write client to produce messages and a client per topic to consume messages. Each client polls the Kafka topic for new records and updates the subscriptions with the new data.
func NewProviderAdapter ¶
func NewProviderAdapter(ctx context.Context, logger *zap.Logger, opts []kgo.Opt, providerOpts datasource.ProviderOpts) (*ProviderAdapter, error)
func (*ProviderAdapter) Publish ¶
func (p *ProviderAdapter) Publish(ctx context.Context, conf datasource.PublishEventConfiguration, events []datasource.StreamEvent) error
Publish publishes the given events to the Kafka topic in a non-blocking way. Publish errors are logged and returned as a pubsub error. The events are written with a dedicated write client.
func (*ProviderAdapter) Startup ¶
func (p *ProviderAdapter) Startup(ctx context.Context) (err error)
func (*ProviderAdapter) Subscribe ¶
func (p *ProviderAdapter) Subscribe(ctx context.Context, conf datasource.SubscriptionEventConfiguration, updater datasource.SubscriptionEventUpdater) error
Subscribe subscribes to the given topics and updates the subscription updater. The engine already deduplicates subscriptions with the same topics, stream configuration, extensions, headers, etc.
type ProviderBuilder ¶
type ProviderBuilder struct {
// contains filtered or unexported fields
}
func NewProviderBuilder ¶
func (*ProviderBuilder) BuildEngineDataSourceFactory ¶
func (p *ProviderBuilder) BuildEngineDataSourceFactory(data *nodev1.KafkaEventConfiguration, providers map[string]datasource.Provider) (datasource.EngineDataSourceFactory, error)
func (*ProviderBuilder) BuildProvider ¶
func (p *ProviderBuilder) BuildProvider(provider config.KafkaEventSource, providerOpts datasource.ProviderOpts) (datasource.Provider, error)
func (*ProviderBuilder) TypeID ¶
func (p *ProviderBuilder) TypeID() string
type PublishDataSource ¶
type PublishDataSource struct {
// contains filtered or unexported fields
}
func (*PublishDataSource) LoadWithFiles ¶
func (s *PublishDataSource) LoadWithFiles(ctx context.Context, headers http.Header, input []byte, files []*httpclient.FileUpload) (data []byte, err error)
type PublishEventConfiguration ¶
type PublishEventConfiguration struct {
Provider string `json:"providerId"`
Topic string `json:"topic"`
FieldName string `json:"rootFieldName"`
}
PublishEventConfiguration is a public type that is used to allow access to custom fields of the provider
func (*PublishEventConfiguration) ProviderID ¶
func (p *PublishEventConfiguration) ProviderID() string
ProviderID returns the provider ID
func (*PublishEventConfiguration) ProviderType ¶
func (p *PublishEventConfiguration) ProviderType() datasource.ProviderType
ProviderType returns the provider type
func (*PublishEventConfiguration) RootFieldName ¶
func (p *PublishEventConfiguration) RootFieldName() string
RootFieldName returns the root field name
type SubscriptionDataSource ¶
type SubscriptionDataSource struct {
// contains filtered or unexported fields
}
func (*SubscriptionDataSource) Start ¶
func (s *SubscriptionDataSource) Start(ctx *resolve.Context, header http.Header, input []byte, updater datasource.SubscriptionEventUpdater) error
func (*SubscriptionDataSource) SubscriptionEventConfiguration ¶
func (s *SubscriptionDataSource) SubscriptionEventConfiguration(input []byte) datasource.SubscriptionEventConfiguration
type SubscriptionEventConfiguration ¶
type SubscriptionEventConfiguration struct {
Provider string `json:"providerId"`
Topics []string `json:"topics"`
FieldName string `json:"rootFieldName"`
}
SubscriptionEventConfiguration is a public type that is used to allow access to custom fields of the provider
func (*SubscriptionEventConfiguration) ProviderID ¶
func (s *SubscriptionEventConfiguration) ProviderID() string
ProviderID returns the provider ID
func (*SubscriptionEventConfiguration) ProviderType ¶
func (s *SubscriptionEventConfiguration) ProviderType() datasource.ProviderType
ProviderType returns the provider type
func (*SubscriptionEventConfiguration) RootFieldName ¶
func (s *SubscriptionEventConfiguration) RootFieldName() string
RootFieldName returns the root field name