37 lines
842 B
Go
37 lines
842 B
Go
package pkg
|
|
|
|
import (
|
|
"go.uber.org/fx"
|
|
|
|
"base/internal/dto"
|
|
"base/internal/pkg/azure/azbus"
|
|
"base/internal/pkg/azure/communication"
|
|
"base/internal/pkg/database"
|
|
"base/internal/pkg/logger"
|
|
"base/internal/pkg/oauth"
|
|
"base/pkg/cache"
|
|
"base/pkg/metrics"
|
|
"base/pkg/store"
|
|
|
|
"github.com/rs/zerolog"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func NewLandingCache(db *gorm.DB, lg zerolog.Logger, m *metrics.Metrics) cache.Cache[dto.Landing] {
|
|
return cache.New(store.NewPostgresStore[dto.Landing](db, lg, m))
|
|
}
|
|
|
|
var Module = fx.Module(
|
|
"pkg",
|
|
fx.Provide(
|
|
logger.New,
|
|
database.NewRWDatabaseConnection,
|
|
communication.New,
|
|
oauth.New,
|
|
azbus.New,
|
|
fx.Annotate(store.NewPostgresStore[string], fx.ResultTags(`name:"verification_store"`)),
|
|
fx.Annotate(store.NewPostgresStore[string], fx.ResultTags(`name:"reset_password_store"`)),
|
|
NewLandingCache,
|
|
),
|
|
)
|