Documentation ¶
Index ¶
- Constants
- func NewKafka(address string, consumer Consumer, metrics metrics.MetricsPublisher) kafka
- type Config
- type Consumer
- type DecodeMessageFunc
- type Decoder
- func (d *Decoder) AvroMessageToRecord(context context.Context, msg *sarama.ConsumerMessage, includeKey bool) (*models.Record, error)
- func (d *Decoder) DeserializerFor(recordType string) DecodeMessageFunc
- func (d *Decoder) JsonMessageToRecord(context context.Context, msg *sarama.ConsumerMessage, includeKey bool) (*models.Record, error)
- type Notification
Constants ¶
View Source
const (
ConsumerType = "consumer"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecodeMessageFunc ¶
type DecodeMessageFunc func(context.Context, *sarama.ConsumerMessage, bool) (record *models.Record, err error)
DecodeMessageFunc extracts a user-domain request object from an Kafka message object. It's designed to be used in Kafka consumers. One straightforward DecodeMessageFunc could be something that Avro decodes the message body to the concrete response type.
type Decoder ¶
type Decoder struct { SchemaRegistry *schema_registry.SchemaRegistry CodecCache sync.Map }
func (*Decoder) AvroMessageToRecord ¶
func (*Decoder) DeserializerFor ¶
func (d *Decoder) DeserializerFor(recordType string) DecodeMessageFunc
Click to show internal directories.
Click to hide internal directories.