MCPcopy
hub / github.com/uber-go/fx / Invoke

Function Invoke

invoke.go:64–69  ·  view source on GitHub ↗

Invoke registers functions that are executed eagerly on application start. Arguments for these invocations are built using the constructors registered by Provide. Passing multiple Invoke options appends the new invocations to the application's existing list. Unlike constructors, invocations are alw

(funcs ...interface{})

Source from the content-addressed store, hash-verified

62// advanced features, including optional parameters and named instances, see
63// the documentation of the In and Out types.
64func Invoke(funcs ...interface{}) Option {
65 return invokeOption{
66 Targets: funcs,
67 Stack: fxreflect.CallerStack(1, 0),
68 }
69}
70
71type invokeOption struct {
72 Targets []interface{}

Callers 15

TestWindowsMinimalAppFunction · 0.92
TestReplaceSuccessFunction · 0.92
TestReplaceFailureFunction · 0.92
TestOptionalTypesFunction · 0.92
TestNamedTypesFunction · 0.92
TestIgnoreUnexportedFunction · 0.92
TestShutdownFunction · 0.92
TestSupplyFunction · 0.92
ExampleErrorFunction · 0.92
TestAnnotatedFromFunction · 0.92
TestAnnotatedAsFunction · 0.92

Calls 1

CallerStackFunction · 0.92

Tested by 15

TestWindowsMinimalAppFunction · 0.74
TestReplaceSuccessFunction · 0.74
TestReplaceFailureFunction · 0.74
TestOptionalTypesFunction · 0.74
TestNamedTypesFunction · 0.74
TestIgnoreUnexportedFunction · 0.74
TestShutdownFunction · 0.74
TestSupplyFunction · 0.74
ExampleErrorFunction · 0.74
TestAnnotatedFromFunction · 0.74
TestAnnotatedAsFunction · 0.74