codeword/internal/initialize/kafka.go
2025-01-04 17:01:27 +03:00

28 lines
510 B
Go

package initialize
import (
"gitea.pena/PenaSide/codeword/internal/kafka/tariff"
"github.com/twmb/franz-go/pkg/kgo"
"go.uber.org/zap"
)
type BrokersDeps struct {
Logger *zap.Logger
TariffClient *kgo.Client
Topic string
}
type Brokers struct {
TariffProducer *tariff.Producer
}
func NewBrokers(deps BrokersDeps) *Brokers {
return &Brokers{
TariffProducer: tariff.NewProducer(tariff.ProducerDeps{
Logger: deps.Logger,
Client: deps.TariffClient,
Topic: deps.Topic,
}),
}
}