29 lines
777 B
Go
29 lines
777 B
Go
|
package initialize
|
||
|
|
||
|
import (
|
||
|
"go.uber.org/zap"
|
||
|
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/clients"
|
||
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/pkg/customer_clients"
|
||
|
)
|
||
|
|
||
|
type Clients struct {
|
||
|
MailClient *clients.SmtpClient
|
||
|
CustomerClient *customer_clients.CustomersClient
|
||
|
}
|
||
|
|
||
|
func NewClients(cfg Config, logger *zap.Logger) *Clients {
|
||
|
return &Clients{
|
||
|
MailClient: clients.NewSmtpClient(clients.Deps{
|
||
|
SmtpHost: cfg.SmtpHost,
|
||
|
SmtpPort: cfg.SmtpPort,
|
||
|
SmtpSender: cfg.SmtpSender,
|
||
|
ApiKey: cfg.SmtpApiKey,
|
||
|
SmtpApiUrl: cfg.SmtpApiUrl,
|
||
|
}),
|
||
|
CustomerClient: customer_clients.NewCustomersClient(customer_clients.CustomersClientDeps{
|
||
|
Logger: logger,
|
||
|
CustomerServiceHost: cfg.CustomerServiceAddress,
|
||
|
}),
|
||
|
}
|
||
|
}
|