MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Register

Method Register

module/dynamic-module/driver/manager.go:23–32  ·  view source on GitHub ↗
(driver IDriver)

Source from the content-addressed store, hash-verified

21}
22
23func (m *Manager) Register(driver IDriver) {
24 m.drivers.Set(driver.Name(), driver)
25 if drivers, ok := m.driversByGroup.Get(driver.Group()); ok {
26 drivers.Set(driver.Name(), driver)
27 } else {
28 drivers = eosc.BuildUntyped[string, IDriver]()
29 drivers.Set(driver.Name(), driver)
30 m.driversByGroup.Set(driver.Group(), drivers)
31 }
32}
33
34func (m *Manager) Get(name string) (IDriver, bool) {
35 return m.drivers.Get(name)

Callers 1

RegisterFunction · 0.45

Calls 4

SetMethod · 0.65
NameMethod · 0.65
GetMethod · 0.65
GroupMethod · 0.65

Tested by

no test coverage detected