-
Notifications
You must be signed in to change notification settings - Fork 3
/
module.go
41 lines (36 loc) · 1013 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
41
package transport
import (
"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"
"github.com/alexfalkowski/go-service/transport/nsq/marshaller"
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(grpc.UnaryServerInterceptor),
fx.Provide(grpc.StreamServerInterceptor),
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(marshaller.NewMsgPack),
)
// Module for fx.
Module = fx.Options(
GRPCModule,
HTTPModule,
NSQModule,
fx.Invoke(Register),
)
)