Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "framework", fx.Provide( func(vars *env.Env) *fm { return &fm{Env: vars} }, ), fx.Provide(func(ev *env.Env, logger *slog.Logger) (*nats.JetstreamClient, error) { name := "webhook:jetstream-client" nc, err := nats.NewClient(ev.NatsURL, nats.ClientOpts{ Name: name, Logger: logger, }) if err != nil { return nil, errors.NewE(err) } return nats.NewJetstreamClient(nc) }), fx.Provide(func(logger logging.Logger) httpServer.Server { return httpServer.NewServer(httpServer.ServerArgs{Logger: logger}) }), fx.Invoke(func(lf fx.Lifecycle, server httpServer.Server, ev *env.Env) { lf.Append(fx.Hook{ OnStart: func(context.Context) error { return server.Listen(fmt.Sprintf(":%d", ev.HttpPort)) }, OnStop: func(context.Context) error { return server.Close() }, }) }), fx.Provide(func(ev *env.Env) (app.CommsGrpcClient, error) { return grpc.NewGrpcClient(ev.CommsService) }), app.Module, )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.