Skip to content

Commit

Permalink
Add Fx to main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Greenleaf authored and jacobgreenleaf committed Nov 15, 2018
1 parent 0c4ce2d commit af397f5
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 6 deletions.
10 changes: 9 additions & 1 deletion codegen/template_bundle/template_files.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions codegen/templates/main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"syscall"

"go.uber.org/zap"
"go.uber.org/fx"

"github.com/uber/zanzibar/config"
"github.com/uber/zanzibar/runtime"
Expand Down Expand Up @@ -80,6 +81,13 @@ func readFlags() {
}

func main() {
app := fx.New(
fx.Invoke(zanzibarMain),
)
app.Run()
}

func zanzibarMain() {
readFlags()
server, err := createGateway()
if err != nil {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ import:
version: master
- package: gopkg.in/validator.v2
version: master
- package: go.uber.org/fx

# Transitive dependency of fx
- package: go.uber.org/dig

0 comments on commit af397f5

Please sign in to comment.