kafka

package
v0.0.0-...-3f61646 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(c *sarama.Config) ec.Option

Config wraps the sarama kafka configuration

func NewCollectorWithConfig

func NewCollectorWithConfig(cfg *ec.Config) (ec.EventCollector, error)

NewCollectorWithConfig contructs a kafka event collector with `Config`.

Types

type Collector

type Collector struct {
	Client sarama.AsyncProducer
	Topic  string
}

Collector wraps a kafka collector.

func NewCollector

func NewCollector(opts ...ec.Option) (*Collector, error)

NewCollector creates a kafka collector.

func (*Collector) Close

func (c *Collector) Close() error

Close the kafka collector.

func (*Collector) Collect

func (c *Collector) Collect(e *ec.Event) error

Collect send events to kafka.

func (*Collector) CollectByTopic

func (c *Collector) CollectByTopic(topic string, e *ec.Event) error

CollectByTopic send events to kafka by the specified topic.

Jump to

Keyboard shortcuts

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