Documentation ¶
Index ¶
- Variables
- func SetDefaultConfig()
- type Component
- type Config
- type Kafka
- func (k *Kafka) Close()
- func (k *Kafka) ConsumerData(t time.Duration) (*kafka.Message, kafka.ErrorCode, error)
- func (k *Kafka) CreateConsumer() error
- func (k *Kafka) CreateProducerKeepalived(ctx context.Context)
- func (k *Kafka) ProduceData(topic string, key, value []byte)
- func (k *Kafka) ProduceDataSimple(value []byte)
- func (k *Kafka) ProduceDataWithTimeKey(topic string, value []byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var ElementKey = micro.ElementKey("KafkaComponent")
ElementKey is ElementKey for kafka
View Source
var ErrCodeTimedOut = kafka.ErrTimedOut
ErrCodeTimedOut - kafka timeout error
Functions ¶
Types ¶
type Component ¶
type Component struct { micro.EmptyComponent // contains filtered or unexported fields }
Component is Component for kafka
type Config ¶
type Config struct { Enable bool `toml:"enable"` BootStrapServers string `toml:"bootstrapserveres"` // BootStrapServers Broker ClientID string `toml:"clientid"` // GroupID for producer MessageMaxBytes int `toml:"messagemaxbytes"` // MessageMaxBytes Topic string `toml:"topic"` GroupID string `toml:"groupid"` }
Config struct
type Kafka ¶
type Kafka struct {
// contains filtered or unexported fields
}
Kafka -
func (*Kafka) ConsumerData ¶
ConsumerData -
func (*Kafka) CreateProducerKeepalived ¶
CreateProducerKeepalived -
func (*Kafka) ProduceData ¶
ProduceData -
func (*Kafka) ProduceDataSimple ¶
ProduceDataSimple -
func (*Kafka) ProduceDataWithTimeKey ¶
ProduceDataWithTimeKey -
Click to show internal directories.
Click to hide internal directories.