kafka

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2020 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Overview

Package kafka is bp-go-lib's kafka middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAvroRecord added in v0.2.3

func DecodeAvroRecord(bytes []byte, obj interface{}) error

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
}

func (*BpProducer) Produce added in v0.2.4

func (bpp *BpProducer) Produce(topic string, key []byte, value []byte) (err error)

Directories

Path Synopsis
Package avsc is bp-go-lib's kafka avsc files path.
Package avsc is bp-go-lib's kafka avsc files path.
Package record is bp-go-lib's kafka record files path.
Package record is bp-go-lib's kafka record files path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL