MCPcopy Create free account
hub / github.com/DoNewsCode/core / NewFactory

Function NewFactory

di/factory.go:28–32  ·  view source on GitHub ↗

NewFactory creates a new factory.

(constructor func(name string) (Pair, error))

Source from the content-addressed store, hash-verified

26
27// NewFactory creates a new factory.
28func NewFactory(constructor func(name string) (Pair, error)) *Factory {
29 return &Factory{
30 constructor: constructor,
31 }
32}
33
34// Make creates an instance under the provided name. It an instance is already
35// created and it is not nil, that instance is returned to the caller.

Callers 14

provideMongoFactoryFunction · 0.92
provideRedisFactoryFunction · 0.92
provideFactoryFunction · 0.92
provideDBFactoryFunction · 0.92
provideReaderFactoryFunction · 0.92
provideWriterFactoryFunction · 0.92
provideFactoryFunction · 0.92
provideEsFactoryFunction · 0.92
TestFactoryFunction · 0.85
TestFactory_nilCloserFunction · 0.85
TestFactory_WatchFunction · 0.85

Calls

no outgoing calls

Tested by 6

TestFactoryFunction · 0.68
TestFactory_nilCloserFunction · 0.68
TestFactory_WatchFunction · 0.68