This commit is contained in:
@@ -31,18 +31,21 @@ type Database struct {
|
||||
}
|
||||
|
||||
func New(lc fx.Lifecycle, params DatabaseParams) (*Database, error) {
|
||||
s.log.Info().Msg("Database instantiated")
|
||||
s := new(Database)
|
||||
s.params = params
|
||||
s.log = params.Logger.Get()
|
||||
|
||||
s.log.Info().Msg("Database instantiated")
|
||||
|
||||
lc.Append(fx.Hook{
|
||||
OnStart: func(ctx context.Context) error {
|
||||
s.log.Info().Msg("Database OnStart Hook")
|
||||
// FIXME connect to db
|
||||
return nil
|
||||
},
|
||||
OnStop: func(ctx context.Context) error {
|
||||
// FIXME disconnect from db
|
||||
return nil
|
||||
},
|
||||
})
|
||||
return s, nil
|
||||
|
||||
Reference in New Issue
Block a user