Documentation ¶
Index ¶
- Variables
- func AddTypedHandler[T any](cg ConsumerGroup, topic common.Topic, f common.MessageHandlerTyped[T]) error
- func CreateConfig(cfg *config.Config) common.Config
- func TypedSend[T any](sp SyncProducer, topic string, message T, opts ...syncproducer.SendOptions) error
- type ConsumerGroup
- type Kafka
- type SyncProducer
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = types.Module{ {CreateFunc: NewKafka}, {CreateFunc: CreateConfig}, }
Functions ¶
func AddTypedHandler ¶ added in v1.0.23
func AddTypedHandler[T any]( cg ConsumerGroup, topic common.Topic, f common.MessageHandlerTyped[T], ) error
func TypedSend ¶ added in v1.0.24
func TypedSend[T any]( sp SyncProducer, topic string, message T, opts ...syncproducer.SendOptions, ) error
Types ¶
type ConsumerGroup ¶
type Kafka ¶
type Kafka struct {
// contains filtered or unexported fields
}
func (*Kafka) NewConsumerGroup ¶
func (k *Kafka) NewConsumerGroup(nameGroup string, opts ...consumergroup.ConsumerGroupOption) (ConsumerGroup, error)
func (*Kafka) NewSyncProducer ¶
func (k *Kafka) NewSyncProducer(opts ...syncproducer.SyncProducerOption) (SyncProducer, error)
type SyncProducer ¶
type SyncProducer interface { Send(topic string, message []byte, opts ...syncproducer.SendOptions) error Close() error }
Click to show internal directories.
Click to hide internal directories.