Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPHandler ¶
type HTTPHandler struct {
Logger *slog.Logger
KafkaProducer sarama.AsyncProducer
ProducerMessageQueue chan *sarama.ProducerMessage
}
HTTPHandler represents http handler functionality.
func (HTTPHandler) MessageWorker ¶
func (h HTTPHandler) MessageWorker(workedID int)
MessageWorker consumes produced messages.
func (HTTPHandler) Shutdown ¶
func (h HTTPHandler) Shutdown()
Shutdown closes producer message queue channel.
type Handler ¶
type Handler interface {
MessageWorker(workedID int)
}
Handler defines http handler behaviours.
type Option ¶
type Option func(*HTTPHandler) error
Option represents option function type.
func WithKafkaProducer ¶
func WithKafkaProducer(kp sarama.AsyncProducer) Option
WithKafkaProducer sets kafka producer.
func WithProducerMessageQueue ¶
func WithProducerMessageQueue(mq chan *sarama.ProducerMessage) Option
WithProducerMessageQueue sets kafka producer message queue.
Click to show internal directories.
Click to hide internal directories.