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

Struct Factory

di/factory.go:20–25  ·  view source on GitHub ↗

Factory is a concurrent safe, generic factory for databases and connections.

Source from the content-addressed store, hash-verified

18
19// Factory is a concurrent safe, generic factory for databases and connections.
20type Factory struct {
21 group singleflight.Group
22 cache sync.Map
23 constructor func(name string) (Pair, error)
24 reloadOnce sync.Once
25}
26
27// NewFactory creates a new factory.
28func NewFactory(constructor func(name string) (Pair, error)) *Factory {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected