Documentation ¶
Index ¶
- Constants
- Variables
- func Full() fx.Option
- func Module(tf klogga.TracerProvider) fx.Option
- func RegisterRunners(r RunnersGroup, lc fx.Lifecycle)
- func RegisterRunnersWithErrors(r RunnersGroup, tf klogga.TracerProvider, lc fx.Lifecycle, s fx.Shutdowner)
- func ToHook(r Runner) fx.Hook
- func ToHookWithCtx(r Runner, onStopped context.CancelFunc) fx.Hook
- type Runner
- type RunnerErr
- type RunnersGroup
Constants ¶
View Source
const Component klogga.ComponentName = "fx"
View Source
const RunnersGroupName = "runners"
Variables ¶
View Source
var ResultTagRunner = fx.ResultTags(RunnersGroupAttribute)
View Source
var RunnersGroupAttribute = fmt.Sprintf(`group:"%s"`, RunnersGroupName)
View Source
var TagRunner = []fx.Annotation{fx.As(new(Runner)), ResultTagRunner}
Functions ¶
func Full ¶
Full Set up the default logging for the app registering logging and the klogga factory, that later can be reconfigured with more loggers
func Module ¶
func Module(tf klogga.TracerProvider) fx.Option
Module send fx logs to standard tracer
func RegisterRunners ¶
func RegisterRunners(r RunnersGroup, lc fx.Lifecycle)
func RegisterRunnersWithErrors ¶
func RegisterRunnersWithErrors(r RunnersGroup, tf klogga.TracerProvider, lc fx.Lifecycle, s fx.Shutdowner)
RegisterRunnersWithErrors experimental watch for runner errors via channel
func ToHookWithCtx ¶
func ToHookWithCtx(r Runner, onStopped context.CancelFunc) fx.Hook
Types ¶
type Runner ¶
type Runner interface { // Start starts the runner, start process can timeout by context // runner is responsible for creating goroutines etc // should not block and exit when startup is done Start(ctx context.Context) error // Stop stops the runner, the stop process can timeout by contest Stop(ctx context.Context) error }
Runner simplifies registration of components that should start and stop
type RunnersGroup ¶
func (RunnersGroup) Register ¶
func (rr RunnersGroup) Register(lc fx.Lifecycle)
func (RunnersGroup) RegisterWithErrors ¶
func (rr RunnersGroup) RegisterWithErrors(tf klogga.TracerProvider, lc fx.Lifecycle, s fx.Shutdowner)
Click to show internal directories.
Click to hide internal directories.