confluent

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package confluent provides functions for creating Kafka consumers and producers connected to Confluent Cloud.

Index

Constants

View Source
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

func CreateTopic(producer k.Producer, topic string) error

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

func CreateTopics(producer k.Producer, topics []string, config map[string]string) error

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

func NewConsumer(config map[string]string) (k.Consumer, error)

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

func NewProducer(config map[string]string) (k.Producer, error)

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

func ReadConfluentCloudConfig(configFile string) map[string]string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳