Skip to content

Commit

Permalink
feat: Upgrade uber/fx to v1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Mar 15, 2022
1 parent 0b5a1c2 commit e36d5cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 3 additions & 7 deletions cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ func NewContainer(v *viper.Viper, options ...fx.Option) *fx.App {
)

// Api middlewares
options = append(options, routes.ProvideMiddlewares(func(params struct {
fx.In
TracerProvider trace.TracerProvider `optional:"true"`
}) []gin.HandlerFunc {
options = append(options, routes.ProvideMiddlewares(func(tp trace.TracerProvider) []gin.HandlerFunc {
res := make([]gin.HandlerFunc, 0)

cc := cors.DefaultConfig()
Expand All @@ -157,7 +154,7 @@ func NewContainer(v *viper.Viper, options ...fx.Option) *fx.App {

res = append(res, cors.New(cc))
if viper.GetBool(otelTracesFlag) {
res = append(res, otelgin.Middleware("ledger", otelgin.WithTracerProvider(params.TracerProvider)))
res = append(res, otelgin.Middleware("ledger", otelgin.WithTracerProvider(tp)))
}
res = append(res, middlewares.Log())
var writer io.Writer = os.Stderr
Expand All @@ -174,9 +171,8 @@ func NewContainer(v *viper.Viper, options ...fx.Option) *fx.App {
}
}))
res = append(res, middlewares.Auth(viper.GetString(serverHttpBasicAuthFlag)))

return res
}))
}, fx.ParamTags(`optional:"true"`)))

return fx.New(options...)
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ require (
go.opentelemetry.io/otel/sdk v1.3.0
go.opentelemetry.io/otel/sdk/metric v0.26.0
go.opentelemetry.io/otel/trace v1.4.1
go.uber.org/dig v1.13.0
go.uber.org/fx v1.16.0
go.uber.org/dig v1.14.0
go.uber.org/fx v1.17.0
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,13 @@ go.uber.org/dig v1.10.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw=
go.uber.org/dig v1.12.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw=
go.uber.org/dig v1.13.0 h1:bb9lVW3gtpQsNb07d0xL5vFwsjHidPJxaR/zSsbmfVQ=
go.uber.org/dig v1.13.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw=
go.uber.org/dig v1.14.0 h1:VmGvIH45/aapXPQkaOrK5u4B5B7jxZB98HM/utx0eME=
go.uber.org/dig v1.14.0/go.mod h1:jHAn/z1Ld1luVVyGKOAIFYz/uBFqKjjEEdIqVAqfQ2o=
go.uber.org/fx v1.13.1/go.mod h1:bREWhavnedxpJeTq9pQT53BbvwhUv7TcpsOqcH4a+3w=
go.uber.org/fx v1.16.0 h1:N8i80+X1DCX+qMRiKzM+jPPZiIiyK/bVCysga3+B+1w=
go.uber.org/fx v1.16.0/go.mod h1:OMoT5BnXcOaiexlpjtpE4vcAmzyDKyRs9TRYXCzamx8=
go.uber.org/fx v1.17.0 h1:e65QHcKzyD58oP6UaA7aYF96XRvnN0pF/rHnwSeRc6I=
go.uber.org/fx v1.17.0/go.mod h1:SPbDO5WX0JpqR7C/JW09j7WC+gWI8kRG1uGM9mGsIH0=
go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI=
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
Expand Down

0 comments on commit e36d5cb

Please sign in to comment.