Documentation
¶
Overview ¶
Package confluent provides functions for creating Kafka consumers and producers connected to Confluent Cloud.
Index ¶
- Constants
- func CreateTopic(producer k.Producer, topic string) error
- func CreateTopics(producer k.Producer, topics []string, config map[string]string) error
- func NewConsumer(config map[string]string) (k.Consumer, error)
- func NewProducer(config map[string]string) (k.Producer, error)
- func ReadConfluentCloudConfig(configFile string) map[string]string
- type NewAdminClient
Constants ¶
const ( AdminOperationTimeout = "admin.operation.timeout" AutoOffsetReset = "auto.offset.reset" GroupId = "group.id" NumPartitions = "topic.partitions" ReplicationFactor = "topic.replication.factor" DefaultAdminOperationTimeout = "60s" DefaultNumPartitions = "1" DefaultReplicationFactor = "3" )
Variables ¶
This section is empty.
Functions ¶
func CreateTopic ¶
CreateTopic creates a topic using the Admin Client API with default settings. This function returns an error if the topic does not exist and cannot be created for any reason.
func CreateTopics ¶ added in v1.1.0
CreateTopics creates one or more topics using the Admin Client API. This function returns an error if the topics do not exist and cannot be created for any reason.
func NewConsumer ¶
Create a new Kafka consumer, using the specified configuration settings. An error will be returned if the given configuration does not provide a consumer group ID, or if the consumer cannot connect to the specified host for any reason.
func NewProducer ¶
Create a new Kafka producer, using the specified configuration settings. An error will be returned if the producer cannot connect to the specified host for any reason.
func ReadConfluentCloudConfig ¶
Read the Confluent Cloud configuration settings from the file at the given path. This function will panic if settings cannot be fully read from the file for any reason.
Types ¶
type NewAdminClient ¶ added in v1.1.0
type NewAdminClient func(p k.Producer) (k.AdminClient, error)
A function which creates a new Kafka admin client from the given producer.