Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface {
// Subscribe consumes the events of a topic and passes the event to the
// informed callback function. The method call blocks until an error occurs.
// The program may also specify a context to asynchronously cancel the blocking operation.
Subscribe(ctx context.Context, callbackFn func(event *Event, err error))
// Close closes the stream, preventing the program from reading any more
// events from it.
Close()
}
Consumer provide methods for consuming events on a given topic.
type Kafka ¶
type Kafka interface {
// NewProducer creates a new Producer to produce events on a topic.
NewProducer(topic string) Producer
// NewConsumer creates a new Consumer to consume events from a topic.
NewConsumer(groupID, topic string) Consumer
// Debug enables logging of incoming events.
Debug(debug bool)
}
Kafka it is an abstraction to send and consume events from an event kafka service.
type Producer ¶
type Producer interface {
// Publish produces and sends an event for a kafka topic.
// The context passed as first argument may also be used to asynchronously
// cancel the operation.
Publish(ctx context.Context, key []byte, values ...[]byte) error
// Close flushes pending writes, and waits for all writes to complete before
// returning.
Close()
}
Producer provide methods for producing events for a given topic.
Click to show internal directories.
Click to hide internal directories.