kafka

package
v2.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeatureLogToKafka

func FeatureLogToKafka(kafkaName string, f FeatureLogKafkaFunc)

func Load

func Load(config *recconf.RecommendConfig)

Types

type FeatureLogKafkaFunc

type FeatureLogKafkaFunc func(*KafkaProducer, *module.User, []*module.Item, *context.RecommendContext)

type KafkaLog

type KafkaLog struct {
}

func (*KafkaLog) Errorf

func (l *KafkaLog) Errorf(msg string, args ...interface{})

type KafkaProducer

type KafkaProducer struct {
	BootstrapServers string
	Topic            string
	Producer         *kafka.Writer
}

func GetKafkaProducer

func GetKafkaProducer(name string) (*KafkaProducer, error)

func NewKafkaProducer

func NewKafkaProducer(bootstrapServers, topic string) *KafkaProducer

func (*KafkaProducer) Close

func (k *KafkaProducer) Close()

func (*KafkaProducer) Init

func (k *KafkaProducer) Init() error

func (*KafkaProducer) SendMessage

func (k *KafkaProducer) SendMessage(message []byte)

func (*KafkaProducer) SendMessages

func (k *KafkaProducer) SendMessages(module []byte, message []byte)

Jump to

Keyboard shortcuts

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