MCPcopy Create free account
hub / github.com/buggregator/server / modulesFromCSV

Function modulesFromCSV

internal/app/config.go:244–262  ·  view source on GitHub ↗

modulesFromCSV creates ModulesConfig from a comma-separated list of enabled types. Types not in the list are disabled.

(csv string)

Source from the content-addressed store, hash-verified

242// modulesFromCSV creates ModulesConfig from a comma-separated list of enabled types.
243// Types not in the list are disabled.
244func modulesFromCSV(csv string) ModulesConfig {
245 enabled := make(map[string]bool)
246 for _, t := range strings.Split(csv, ",") {
247 enabled[strings.TrimSpace(t)] = true
248 }
249
250 t, f := true, false
251 return ModulesConfig{
252 Sentry: boolPtr(enabled["sentry"], t, f),
253 Ray: boolPtr(enabled["ray"], t, f),
254 VarDump: boolPtr(enabled["var-dump"], t, f),
255 Inspector: boolPtr(enabled["inspector"], t, f),
256 Monolog: boolPtr(enabled["monolog"], t, f),
257 SMTP: boolPtr(enabled["smtp"], t, f),
258 SMS: boolPtr(enabled["sms"], t, f),
259 HttpDump: boolPtr(enabled["http-dump"], t, f),
260 Profiler: boolPtr(enabled["profiler"], t, f),
261 }
262}
263
264func boolPtr(cond bool, yes, no bool) *bool {
265 if cond {

Callers 2

TestModulesFromCSVFunction · 0.85
LoadConfigFunction · 0.85

Calls 1

boolPtrFunction · 0.85

Tested by 1

TestModulesFromCSVFunction · 0.68