Documentation ¶
Index ¶
- Variables
- func EnsureTopic(topic string, kafkaUrl string, knownTopics *map[string]bool, ...) (err error)
- func GetBroker(bootstrapUrl string) (brokers []string, err error)
- func GetTopicConfig(configMap map[string][]kafka.ConfigEntry, topic string) []kafka.ConfigEntry
- func InitTopic(kafkaUrl string, configMap map[string][]kafka.ConfigEntry, topics ...string) (err error)
- func InitTopicWithConfig(bootstrapUrl string, configMap map[string][]kafka.ConfigEntry, ...) (err error)
- func NewConsumer(ctx context.Context, config ConsumerConfig, ...) (err error)
- type AsyncProducer
- type Config
- type ConsumerConfig
- type ProducerInterface
- type SyncProducer
Constants ¶
This section is empty.
Variables ¶
View Source
var Fatal = false
View Source
var SlowProducerTimeout time.Duration = 2 * time.Second
Functions ¶
func EnsureTopic ¶
func GetTopicConfig ¶
func InitTopicWithConfig ¶
Types ¶
type AsyncProducer ¶
type AsyncProducer struct {
// contains filtered or unexported fields
}
func (*AsyncProducer) Log ¶
func (this *AsyncProducer) Log(logger *log.Logger)
func (*AsyncProducer) Produce ¶
func (this *AsyncProducer) Produce(topic string, message string) (err error)
func (*AsyncProducer) ProduceWithKey ¶
func (this *AsyncProducer) ProduceWithKey(topic string, message string, key string) (err error)
type ConsumerConfig ¶
type ProducerInterface ¶
type ProducerInterface interface { Produce(topic string, message string) (err error) ProduceWithKey(topic string, message string, key string) (err error) Log(logger *log.Logger) }
func PrepareProducer ¶
func PrepareProducer(ctx context.Context, kafkaBootstrapUrl string, sync bool, syncIdempotent bool, partitionNum int, replicationFactor int) (result ProducerInterface, err error)
deprecated
type SyncProducer ¶
type SyncProducer struct {
// contains filtered or unexported fields
}
func (*SyncProducer) Log ¶
func (this *SyncProducer) Log(logger *log.Logger)
func (*SyncProducer) Produce ¶
func (this *SyncProducer) Produce(topic string, message string) (err error)
func (*SyncProducer) ProduceWithKey ¶
func (this *SyncProducer) ProduceWithKey(topic string, message string, key string) (err error)
Click to show internal directories.
Click to hide internal directories.