manager

package
v0.0.0-...-11ae941 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKafkaTopicManager

func NewKafkaTopicManager(
	ctx context.Context,
	defaultTopic string,
	changefeedID model.ChangeFeedID,
	admin kafka.ClusterAdminClient,
	cfg *kafka.AutoCreateTopicConfig,
) *kafkaTopicManager

NewKafkaTopicManager creates a new topic manager.

Types

type PulsarTopicManager

type PulsarTopicManager func(
	cfg *config.PulsarConfig,
	client pulsar.Client,
) (TopicManager, error)

PulsarTopicManager is a manager for pulsar topics.

type TopicManager

type TopicManager interface {
	// GetPartitionNum returns the number of partitions of the topic.
	GetPartitionNum(ctx context.Context, topic string) (int32, error)
	// CreateTopicAndWaitUntilVisible creates the topic and wait for the topic completion.
	CreateTopicAndWaitUntilVisible(ctx context.Context, topicName string) (int32, error)
	// Close closes the topic manager.
	Close()
}

TopicManager is the interface of topic manager. It will be responsible for creating and updating the information of the topic.

func NewMockPulsarTopicManager

func NewMockPulsarTopicManager(
	cfg *config.PulsarConfig,
	client pulsar.Client,
) (TopicManager, error)

NewMockPulsarTopicManager creates a new topic manager.

func NewPulsarTopicManager

func NewPulsarTopicManager(
	cfg *config.PulsarConfig,
	client pulsar.Client,
) (TopicManager, error)

NewPulsarTopicManager creates a new topic manager.

Jump to

Keyboard shortcuts

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