kafka

package
v0.0.0-...-d5e5b72 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

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 (*Event) GetData

func (e *Event) GetData() []byte

func (*Event) GetHeaders

func (e *Event) GetHeaders() map[string][]byte

func (*Event) GetKey

func (e *Event) GetKey() []byte

type EventType

type EventType int
const (
	EventTypePublish EventType = iota
	EventTypeSubscribe
)

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 (*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

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) Shutdown

func (p *ProviderAdapter) Shutdown(ctx context.Context) error

func (*ProviderAdapter) Startup

func (p *ProviderAdapter) Startup(ctx context.Context) (err error)

func (*ProviderAdapter) Subscribe

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 NewProviderBuilder(
	ctx context.Context,
	logger *zap.Logger,
	hostName string,
	routerListenAddr string,
) *ProviderBuilder

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) Load

func (s *PublishDataSource) Load(ctx context.Context, headers http.Header, input []byte) (data []byte, err error)

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

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 (*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

ProviderType returns the provider type

func (*SubscriptionEventConfiguration) RootFieldName

func (s *SubscriptionEventConfiguration) RootFieldName() string

RootFieldName returns the root field name

Jump to

Keyboard shortcuts

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