Documentation
¶
Overview ¶
Package kafka is bp-go-lib's kafka middleware.
Index ¶
- func DecodeAvroRecord(bytes []byte, obj interface{}) error
- func EncodeAvroRecord(obj container.AvroRecord) ([]byte, error)
- type BpConsumer
- type BpKafkaBuilder
- func (bpb *BpKafkaBuilder) AddConfig(configMap *kafka.ConfigMap) *BpKafkaBuilder
- func (bpb *BpKafkaBuilder) BuildConsumer() (*BpConsumer, error)
- func (bpb *BpKafkaBuilder) BuildProducer() (*BpProducer, error)
- func (bpb *BpKafkaBuilder) SetConfig(configMap *kafka.ConfigMap) *BpKafkaBuilder
- func (bpb *BpKafkaBuilder) SetGroupId(id string) *BpKafkaBuilder
- type BpProducer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAvroRecord ¶ added in v0.2.3
func EncodeAvroRecord ¶ added in v0.2.2
func EncodeAvroRecord(obj container.AvroRecord) ([]byte, error)
Types ¶
type BpConsumer ¶ added in v0.2.4
type BpConsumer struct {
// contains filtered or unexported fields
}
func (*BpConsumer) Consume ¶ added in v0.2.4
func (bpc *BpConsumer) Consume(topic string, subscribeFunc func(interface{}, interface{})) (err error)
type BpKafkaBuilder ¶
type BpKafkaBuilder struct {
// contains filtered or unexported fields
}
func NewKafkaBuilder ¶
func NewKafkaBuilder() *BpKafkaBuilder
func (*BpKafkaBuilder) AddConfig ¶
func (bpb *BpKafkaBuilder) AddConfig(configMap *kafka.ConfigMap) *BpKafkaBuilder
AddConfig add kafka config by ConfigMap. ConfigMap is a map contaning standard librdkafka configuration properties as documented in: https://github.com/edenhill/librdkafka/tree/master/CONFIGURATION.md
func (*BpKafkaBuilder) BuildConsumer ¶
func (bpb *BpKafkaBuilder) BuildConsumer() (*BpConsumer, error)
func (*BpKafkaBuilder) BuildProducer ¶
func (bpb *BpKafkaBuilder) BuildProducer() (*BpProducer, error)
func (*BpKafkaBuilder) SetConfig ¶
func (bpb *BpKafkaBuilder) SetConfig(configMap *kafka.ConfigMap) *BpKafkaBuilder
SetConfig set kafka config by ConfigMap. ConfigMap is a map contaning standard librdkafka configuration properties as documented in: https://github.com/edenhill/librdkafka/tree/master/CONFIGURATION.md
func (*BpKafkaBuilder) SetGroupId ¶
func (bpb *BpKafkaBuilder) SetGroupId(id string) *BpKafkaBuilder
type BpProducer ¶ added in v0.2.4
type BpProducer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.