MCPcopy Create free account
hub / github.com/foxcpp/maddy / Register

Function Register

framework/module/modules/modules.go:63–72  ·  view source on GitHub ↗

Register adds module factory function to global registry. name must be unique. Register will panic if module with specified name already exists in registry. You probably want to call this function from func init() of module package.

(name string, factory FuncNewModule)

Source from the content-addressed store, hash-verified

61//
62// You probably want to call this function from func init() of module package.
63func Register(name string, factory FuncNewModule) {
64 modulesLock.Lock()
65 defer modulesLock.Unlock()
66
67 if _, ok := modules[name]; ok {
68 panic("Register: module with specified name is already registered: " + name)
69 }
70
71 modules[name] = factory
72}
73
74// RegisterDeprecated adds module factory function to global registry.
75//

Callers 15

initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected