Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(func(lc fx.Lifecycle, logger *zap.Logger, validate *validator.Validate) (access.Service, prime.Service, error) { db, err := open.Open(open.DB{ User: env.Get(usernameKey), Pass: env.Get(passwordKey), Name: env.Get(dbNameKey), }) if err != nil { return nil, nil, err } lc.Append(fx.Hook{ OnStart: func(ctx context.Context) error { return open.Ping(ctx, db) }, OnStop: miscfx.IgnoreContext(db.Close), }) userService := user.Use( repo.UserRepoForDB(db), logger, validate, ) accessService := access.Use( repo.AccessRepoForDB(db), logger, []byte(env.Get(refreshSecretKey)), []byte(env.Get(accessSecretKey)), ) lc.Append(miscfx.CronJob(func() { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() accessService.RemExpired(ctx) }, time.Minute)) return accessService, prime.Use(userService, accessService), nil }), fx.Invoke(data.RegisterPasswordValidator), fx.Invoke(routes.Register), )
Module bundles fx.Options for the user Fx Module.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.