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) (service.Service, error) { opts := options.Client().ApplyURI(env.Get(dbURIKey)) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() client, err := mongo.Connect(ctx, opts) if err != nil { return nil, err } lc.Append(fx.Hook{ OnStart: func(ctx context.Context) error { return client.Ping(ctx, nil) }, OnStop: client.Disconnect, }) coll := client.Database(env.Get(dbNameKey)).Collection(env.Get(collectionKey)) return service.Use(repo.UseCollection(coll), logger, validate), nil }), fx.Invoke(data.RegisterValidators), fx.Invoke(routes.Register), )
Module bundles fx.Options for the feed Fx Module.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.