codeword/internal/initialize/clients.go

31 lines
797 B
Go
Raw Normal View History

2024-01-04 11:27:50 +00:00
package initialize
import (
"codeword/internal/adapters/client"
"github.com/gofiber/fiber/v2"
"go.uber.org/zap"
)
2024-01-05 11:37:06 +00:00
func RecoveryEmailSender(cfg Config, logger *zap.Logger) *client.RecoveryEmailSender {
2024-01-04 11:27:50 +00:00
return client.NewRecoveryEmailSender(client.RecoveryEmailSenderDeps{
2024-01-18 12:40:15 +00:00
SmtpApiUrl: cfg.SmtpApiUrl,
SmtpHost: cfg.SmtpHost,
SmtpPort: cfg.SmtpPort,
SmtpSender: cfg.SmtpSender,
Username: cfg.SmtpUsername,
Password: cfg.SmtpPassword,
ApiKey: cfg.SmtpApiKey,
FiberClient: &fiber.Client{},
Logger: logger,
RecoveryUrl: cfg.RecoveryUrl,
2024-01-04 11:27:50 +00:00
})
}
2024-01-04 14:57:30 +00:00
2024-01-05 11:37:06 +00:00
func AuthClient(cfg Config, logger *zap.Logger) *client.AuthClient {
2024-01-04 14:57:30 +00:00
return client.NewAuthClient(client.AuthClientDeps{
AuthUrl: cfg.AuthURL,
Logger: logger,
FiberClient: &fiber.Client{},
})
}