Categorygithub.com/goph/fxt
modulepackage
0.30.0
Repository: https://github.com/goph/fxt.git
Documentation: pkg.go.dev

# README

Extensions for Uber's fx

Build Status Go Report Card GoDoc

fxt is an application builder kit mainly based on go.uber.org/fx.

Installation

Minimum Go version: 1.9

Since this library uses Glide I recommend using it in your project as well.

$ glide get github.com/goph/fxt

Usage

As you will see, the top level (and some deeper level) packages have the fx prefix in their package name, but not in their directory name. The reason for the prefix is simple: avoiding name collisions. This is however not really idiomatic Go: although the package name can be different from the directory name, it is recommended that they are the same for clarity. In this case the prefix is consistent though and I found it would probably be harder to read directory names, so I left the original versions there. Ideally an IDE should be able to handle this.

I'm going to continue using and testing it and might change the directory names as well if it turns out to be too confusing.

License

The MIT License (MIT). Please see License File for more information.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

New creates a new App and in turn an fx.App instance.
NewLifecycle creates a new lifecycle required by all constructors providing closers.
WithTimeout makes a function susceptible to deadlines.

# Variables

Bootstrap can be used as an alias for must have provider options composed into one fx option.

# Structs

App wraps the original fx.App instance and adds a closer method to it.
ApplicationInfo is an optional set of information that can be set by the runtime environment (eg.
Hook is a set of callbacks extending fx.Hook.

# Interfaces

Closer is the interface modelled after io.Closer for post-shutdown cleanups.
Lifecycle extends fx.Lifecycle by adding the extra OnClose in Hook.