MCPcopy
hub / github.com/marmotedu/iam / initialize

Method initialize

internal/pump/server.go:131–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129}
130
131func (s *pumpServer) initialize() {
132 pmps = make([]pumps.Pump, len(s.pumps))
133 i := 0
134 for key, pmp := range s.pumps {
135 pumpTypeName := pmp.Type
136 if pumpTypeName == "" {
137 pumpTypeName = key
138 }
139
140 pmpType, err := pumps.GetPumpByName(pumpTypeName)
141 if err != nil {
142 log.Errorf("Pump load error (skipping): %s", err.Error())
143 } else {
144 pmpIns := pmpType.New()
145 initErr := pmpIns.Init(pmp.Meta)
146 if initErr != nil {
147 log.Errorf("Pump init error (skipping): %s", initErr.Error())
148 } else {
149 log.Infof("Init Pump: %s", pmpIns.GetName())
150 pmpIns.SetFilters(pmp.Filters)
151 pmpIns.SetTimeout(pmp.Timeout)
152 pmpIns.SetOmitDetailedRecording(pmp.OmitDetailedRecording)
153 pmps[i] = pmpIns
154 }
155 }
156 i++
157 }
158}
159
160func writeToPumps(keys []interface{}, purgeDelay int) {
161 // Send to pumps

Callers 1

PrepareRunMethod · 0.95

Calls 10

GetPumpByNameFunction · 0.92
ErrorfFunction · 0.92
InfofFunction · 0.92
ErrorMethod · 0.65
NewMethod · 0.65
InitMethod · 0.65
GetNameMethod · 0.65
SetFiltersMethod · 0.65
SetTimeoutMethod · 0.65

Tested by

no test coverage detected