MCPcopy Create free account

hub / github.com/alecthomas/inject / functions

Functions92 in github.com/alecthomas/inject

↓ 33 callersFunctionSafeNew
SafeNew creates a new SafeInjector. The injector itself is already bound, as is an implementation of the Binder interface.
safe.go:31
↓ 32 callersMethodBind
(things ...interface{})
inject.go:18
↓ 22 callersMethodGet
Get acquires a value of type t from the injector. It is usually preferable to use Call().
inject.go:106
↓ 14 callersMethodBuild
Build returns the type associated with the value being bound, and a function that builds that value at runtime.
annotations.go:13
↓ 14 callersMethodInstall
(module ...interface{})
inject.go:20
↓ 12 callersMethodCall
Call calls f, injecting any arguments, and panics if the function errors.
inject.go:115
↓ 7 callersFunctionAnnotate
Annotate ensures that v is an annotation, and returns it. Specifically: - If v is already an Annotation it will be returned as-is. - If v is a funct
annotations.go:25
↓ 7 callersFunctionSequence
Sequence annotates a provider or binding to indicate it is part of a slice of values implementing the given type. injector.Bind(Sequence([]int{1}))
annotations.go:186
↓ 6 callersMethodBindTo
(to interface{}, impl interface{})
inject.go:19
↓ 6 callersMethodIs
Is checks if the annotation or any children are of the given annotation type.
annotations.go:15
↓ 6 callersFunctionMapping
Mapping annotates a provider or binding to indicate it is part of a mapping of keys to values. injector.Bind(Mapping(map[string]int{"one": 1})) i
annotations.go:243
↓ 4 callersFunctionSingleton
Singleton annotates a provider function to indicate that the provider will only be called once, and that its return value will be used for all subsequ
annotations.go:135
↓ 4 callersMethodString
()
inject_test.go:21
↓ 3 callersMethodValidate
Validate that the function f can be called by the injector.
inject.go:131
↓ 3 callersMethodresolve
(t reflect.Type)
safe.go:229
↓ 2 callersMethodBind
Bind binds a value to the injector. See Injector.Bind() for details.
safe.go:110
↓ 2 callersFunctionLiteral
Literal annotates a value as being provided as-is with no further transformation.
annotations.go:37
↓ 2 callersFunctionProvider
Provider annotates a function to indicate it should be called whenever the type of its return value is requested.
annotations.go:66
↓ 2 callersMethodgetReflected
(t reflect.Type)
safe.go:265
↓ 1 callersMethodBind
Bind binds a value to the injector. Panics on error. See the README (https://github.com/alecthomas/inject/blob/master/README.md) for more details.
inject.go:79
↓ 1 callersMethodBindTo
BindTo binds an implementation to an interface. See Injector.BindTo() for details.
safe.go:128
↓ 1 callersMethodBindTo
BindTo binds an interface to a value. Panics on error. "as" should either be a nil pointer to the required interface: i.BindTo((*fmt.Stringer)(nil
inject.go:96
↓ 1 callersMethodChild
Child creates a child Injector whose bindings overlay those of the parent. The parent will never be modified by the child.
inject.go:126
↓ 1 callersMethodConfigure
(binder Binder)
inject.go:27
↓ 1 callersFunctionNew
New creates a new Injector. An unsafe injector panics on any error. This is commonly used because DI failures are generally not user-recoverable. Th
inject.go:40
↓ 1 callersMethodhandleDuplicate
(existing reflect.Value, incoming reflect.Value)
safe.go:95
↓ 1 callersMethodresolveMapping
(t reflect.Type)
safe.go:196
↓ 1 callersMethodresolveSlice
(t reflect.Type)
safe.go:163
MethodBind
(things ...interface{})
safe.go:21
MethodBindTo
(to interface{}, impl interface{})
safe.go:22
MethodBuild
(*SafeInjector)
annotations.go:49
MethodBuild
(i *SafeInjector)
annotations.go:70
MethodBuild
(i *SafeInjector)
annotations.go:143
MethodBuild
(i *SafeInjector)
annotations.go:194
MethodBuild
(i *SafeInjector)
annotations.go:247
MethodCall
Call f, injecting any arguments.
safe.go:283
MethodChild
Child creates a child SafeInjector whose bindings overlay those of the parent. The parent will never be modified by the child.
safe.go:308
MethodConfigure
(binder Binder)
inject_test.go:366
MethodConfigure
(binder Binder)
inject_test.go:373
MethodGet
Get acquires a value of type t from the injector. It is usually preferable to use Call().
safe.go:261
MethodInstall
(module ...interface{})
safe.go:23
MethodInstall
Install installs a module. See Injector.Install() for details.
safe.go:47
MethodInstall
Install a module. A module is a struct whose methods are providers. This is useful for grouping configuration data together with providers. Duplicate
inject.go:69
MethodIs
(annotation Annotation)
annotations.go:56
MethodIs
(annotation Annotation)
annotations.go:119
MethodIs
(annotation Annotation)
annotations.go:171
MethodIs
(annotation Annotation)
annotations.go:225
MethodIs
(annotation Annotation)
annotations.go:285
MethodProvideInt
(string)
inject_test.go:334
MethodProvideInt
()
inject_test.go:388
MethodProvideString
(i int)
inject_test.go:214
MethodProvideString
(int)
inject_test.go:338
MethodSafe
Safe returns the underlying SafeInjector.
inject.go:136
MethodString
()
annotations.go:45
MethodString
()
inject_test.go:29
MethodString
()
inject_test.go:238
MethodString
()
inject_test.go:242
FunctionTestCallError
(t *testing.T)
inject_test.go:227
FunctionTestChildInjector
(t *testing.T)
inject_test.go:99
FunctionTestDuplicateNamedBindErrors
(t *testing.T)
inject_test.go:302
FunctionTestDynamicInjection
(t *testing.T)
inject_test.go:146
FunctionTestGetUnboundType
(t *testing.T)
inject_test.go:72
FunctionTestInjectorBind
(t *testing.T)
inject_test.go:11
FunctionTestInjectorBindTo
(t *testing.T)
inject_test.go:33
FunctionTestInjectorBindToInvalidImplementation
(t *testing.T)
inject_test.go:65
FunctionTestInjectorBindToStruct
(t *testing.T)
inject_test.go:43
FunctionTestInjectorBindToTypeAlias
(t *testing.T)
inject_test.go:52
FunctionTestInjectorCall
(t *testing.T)
inject_test.go:112
FunctionTestInstallConfigurableModule
(t *testing.T)
inject_test.go:378
FunctionTestInstallDifferingDuplicateModule
(t *testing.T)
inject_test.go:356
FunctionTestInstallIdenticalDuplicateModule
(t *testing.T)
inject_test.go:348
FunctionTestInstallNewNonZeroModuleOverwritesExisting
(t *testing.T)
inject_test.go:401
FunctionTestInstallNewZeroModuleKeepsExisting
(t *testing.T)
inject_test.go:390
FunctionTestInterfaceConversion
(t *testing.T)
inject_test.go:244
FunctionTestIs
(t *testing.T)
inject_test.go:298
FunctionTestLiteral
(t *testing.T)
inject_test.go:190
FunctionTestMapValueInterfaceConversion
(t *testing.T)
inject_test.go:269
FunctionTestMappingAnnotation
(t *testing.T)
inject_test.go:174
FunctionTestMappingIsNotImplicitlyProvided
(t *testing.T)
inject_test.go:291
FunctionTestModule
(t *testing.T)
inject_test.go:216
FunctionTestProvider
(t *testing.T)
inject_test.go:78
FunctionTestProviderCycle
(t *testing.T)
inject_test.go:340
FunctionTestProviderGraph
(t *testing.T)
inject_test.go:90
FunctionTestPseudoBoundValues
(t *testing.T)
inject_test.go:202
FunctionTestSequenceAnnotation
(t *testing.T)
inject_test.go:164
FunctionTestSingletonAnnotation
(t *testing.T)
inject_test.go:127
FunctionTestSingletonToNonProviderPanics
(t *testing.T)
inject_test.go:139
FunctionTestSliceInterfaceConversion
(t *testing.T)
inject_test.go:254
FunctionTestSliceIsNotImplicitlyProvided
(t *testing.T)
inject_test.go:284
FunctionTestValidate
(t *testing.T)
inject_test.go:312
MethodUnsafe
()
safe.go:42
MethodValidate
Validate that the function f can be called by the injector.
safe.go:315