Factory is a concurrent safe, generic factory for databases and connections.
| 18 | |
| 19 | // Factory is a concurrent safe, generic factory for databases and connections. |
| 20 | type 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. |
| 28 | func NewFactory(constructor func(name string) (Pair, error)) *Factory { |
nothing calls this directly
no outgoing calls
no test coverage detected