-
Notifications
You must be signed in to change notification settings - Fork 3
/
module.go
40 lines (35 loc) · 934 Bytes
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package transport
import (
"github.com/alexfalkowski/go-service/nsq"
"github.com/alexfalkowski/go-service/transport/grpc"
gtracer "github.com/alexfalkowski/go-service/transport/grpc/telemetry/tracer"
"github.com/alexfalkowski/go-service/transport/http"
htracer "github.com/alexfalkowski/go-service/transport/http/telemetry/tracer"
ntracer "github.com/alexfalkowski/go-service/transport/nsq/telemetry/tracer"
"go.uber.org/fx"
)
var (
// GRPCModule for fx.
GRPCModule = fx.Options(
fx.Provide(grpc.NewServer),
fx.Provide(gtracer.NewTracer),
)
// HTTPModule for fx.
HTTPModule = fx.Options(
fx.Provide(http.NewServer),
fx.Provide(htracer.NewTracer),
)
// NSQModule for fx.
NSQModule = fx.Options(
fx.Provide(ntracer.NewTracer),
fx.Provide(nsq.NewMsgPackMarshaller),
)
// Module for fx.
Module = fx.Options(
GRPCModule,
HTTPModule,
NSQModule,
fx.Provide(NewServers),
fx.Invoke(Register),
)
)