File size: 385 Bytes
9853396 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | package backup
import (
"context"
"go.uber.org/fx"
)
var Module = fx.Module("backup",
fx.Provide(NewBackupService),
fx.Invoke(func(lc fx.Lifecycle, svc *BackupService) {
lc.Append(fx.Hook{
OnStart: func(ctx context.Context) error {
return svc.Start(ctx)
},
OnStop: func(ctx context.Context) error {
return svc.Stop(ctx)
},
})
}),
)
|