Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(func(lc fx.Lifecycle) reqlogger.Logger { path := env.Get(reqLogPathKey) logger := reqlogger.New(logcrtr.Config(path)) lc.Append(fx.Hook{ OnStop: miscfx.IgnoreContext(logger.Sync), }) return logger }), fx.Provide(func(lc fx.Lifecycle) *zap.Logger { path := env.Get(appLogPathKey) logger := logcrtr.Config(path) lc.Append(fx.Hook{ OnStop: miscfx.IgnoreContext(logger.Sync), }) return logger }), fx.Provide(validator.New), fx.Provide(func(lc fx.Lifecycle, logger reqlogger.Logger) *fiber.App { app := fiber.New(fiber.Config{ ReadTimeout: 5 * time.Second, WriteTimeout: 3 * time.Second, ErrorHandler: errhandler.Handler(logger), }) lc.Append(fx.Hook{ OnStart: miscfx.IgnoreContext(func() error { go app.Listen(":" + env.Get(portKey)) return nil }), OnStop: miscfx.IgnoreContext(app.Shutdown), }) return app }), fx.Invoke(logger.Register), fx.Invoke(data.RegisterValidators), )
Module bundles fx.Options for the app Fx Module.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.