A dependency injection based application framework for Go.
Clone or download
SyrieBianco and abhinav Add Shutdowner to allow shutdown from a module (#660)
This adds a Shutdowner interface with a Shutdown method, providing it to all
Fx applications. This provides the ability to signal app shutdown from any Fx
module.

Note that a channel of signal receivers is used because [os/signal.Notify][1],
and incidentally [fx.App.Done()][2] may be called multiple times, so we need
to notify all channels on shutdown.

  [1]: https://golang.org/pkg/os/signal/#Notify
  [2]: https://godoc.org/go.uber.org/fx#App.Done

Resolves #615
Latest commit 5f6023c Jan 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.build Simplify build scripts (#543) Jul 3, 2017
fxtest Update license header (#663) Jan 11, 2019
internal Update license header (#663) Jan 11, 2019
.codecov.yml Add some more tests (#607) Dec 20, 2017
.gitignore Fix travis (#391) Mar 10, 2017
.travis.yml Update Go versions for CI (#646) Sep 26, 2018
CHANGELOG.md Add Shutdowner to allow shutdown from a module (#660) Jan 16, 2019
CONTRIBUTING.md Make contributing guide more friendly (#548) Jul 5, 2017
LICENSE Update LICENSE file and headers (#612) Jan 4, 2018
Makefile Update Go versions for CI (#646) Sep 26, 2018
README.md README: Remove "Supported Go Versions" (#662) Dec 12, 2018
annotated.go fx.Annotated: Support Value Groups (#659) Jan 15, 2019
annotated_test.go Update license header (#663) Jan 11, 2019
app.go Add Shutdowner to allow shutdown from a module (#660) Jan 16, 2019
app_internal_test.go Update license header (#663) Jan 11, 2019
app_test.go Add Shutdowner to allow shutdown from a module (#660) Jan 16, 2019
doc.go Update license header (#663) Jan 11, 2019
error_example_test.go Update license header (#663) Jan 11, 2019
example_test.go Update license header (#663) Jan 11, 2019
extract.go Update license header (#663) Jan 11, 2019
extract_test.go Update license header (#663) Jan 11, 2019
glide.lock fx.Annotated: Support Value Groups (#659) Jan 15, 2019
glide.yaml fx.Annotated: Support Value Groups (#659) Jan 15, 2019
inout.go Update license header (#663) Jan 11, 2019
inout_test.go Update license header (#663) Jan 11, 2019
lifecycle.go Update license header (#663) Jan 11, 2019
populate.go Update license header (#663) Jan 11, 2019
populate_example_test.go Update license header (#663) Jan 11, 2019
populate_test.go Update license header (#663) Jan 11, 2019
shutdown.go Add Shutdowner to allow shutdown from a module (#660) Jan 16, 2019
shutdown_test.go Add Shutdowner to allow shutdown from a module (#660) Jan 16, 2019
version.go Update license header (#663) Jan 11, 2019

README.md

🦄 Fx GoDoc Github release Build Status Coverage Status Go Report Card

An application framework for Go that:

  • Makes dependency injection easy.
  • Eliminates the need for global state and func init().

Installation

We recommend locking to SemVer range ^1 using Glide:

glide get 'go.uber.org/fx#^1'

Stability

This library is v1 and follows SemVer strictly.

No breaking changes will be made to exported APIs before v2.0.0.

This project follows the Go Release Policy. Each major version of Go is supported until there are two newer major releases.