Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RequireNone the producer won’t even wait for a response from the broker. RequireNone kafka.RequiredAcks = kafka.RequireNone // RequireOne the producer will consider the write successful when the leader receives the record. RequireOne kafka.RequiredAcks = kafka.RequireOne // RequireAll the producer will consider the write successful when all of the in-sync replicas receive the record. RequireAll kafka.RequiredAcks = kafka.RequireAll )
Variables ¶
View Source
var ErrEventFull = errors.New("message event chan full")
ErrEventFull is a message event chan full.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher(config *Config, opts ...PublisherOption) *Publisher
NewPublisher new a kafka publisher.
type PublisherOption ¶
type PublisherOption func(*Publisher)
PublisherOption is a publisher options.
func BatchSize ¶
func BatchSize(size int) PublisherOption
func ReadTimeout ¶
func ReadTimeout(d time.Duration) PublisherOption
ReadTimeout with read timeout option.
func RequiredAcks ¶
func RequiredAcks(acks kafka.RequiredAcks) PublisherOption
RequiredAcks with required acks option.
func WriteTimeout ¶
func WriteTimeout(d time.Duration) PublisherOption
WriteTimeout with write timeout option.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(config *Config, opts ...SubscriberOption) *Subscriber
NewSubscriber new a kafka subscriber.
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
func (*Subscriber) GetEntity ¶
func (s *Subscriber) GetEntity() *kafka.Reader
func (*Subscriber) ReadMessage ¶
func (s *Subscriber) ReadMessage(ctx context.Context) (kafka.Message, error)
type SubscriberOption ¶
type SubscriberOption func(*Subscriber)
SubscriberOption is a subscriber option.
Click to show internal directories.
Click to hide internal directories.