initial commit
This commit is contained in:
36
internal/pkg/module.go
Normal file
36
internal/pkg/module.go
Normal file
@@ -0,0 +1,36 @@
|
||||
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,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user