Add db module
This commit is contained in:
26
internal/service/database/module.go
Normal file
26
internal/service/database/module.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"payouts/internal/config"
|
||||
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
|
||||
var Module = fx.Options(
|
||||
fx.Provide(New),
|
||||
)
|
||||
|
||||
type DatabaseService interface {
|
||||
}
|
||||
|
||||
// Params represents the module input params
|
||||
type Params struct {
|
||||
fx.In
|
||||
|
||||
AppConfig *config.App
|
||||
}
|
||||
|
||||
// NewPersistence instantiates the persistence module
|
||||
func New(p Params) (DatabaseService, error) {
|
||||
return NewDatabaseService(p.AppConfig.Database.Type, p.AppConfig.Database.Connection, p.AppConfig.Database.LogLevel)
|
||||
}
|
||||
Reference in New Issue
Block a user