codeword/internal/initialize/kafka.go

28 lines
510 B
Go
Raw Normal View History

2024-01-17 13:51:42 +00:00
package initialize
import (
2024-11-22 11:22:08 +00:00
"gitea.pena/PenaSide/codeword/internal/kafka/tariff"
2024-01-17 13:51:42 +00:00
"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,
}),
}
}