MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / IsIntegrationEnabled

Method IsIntegrationEnabled

agent-source-code/internal/config/config.go:456–486  ·  view source on GitHub ↗

IsIntegrationEnabled checks if an integration is enabled Returns false if not specified (default behavior - integrations are disabled by default) For compliance, returns true if enabled (true) or on-demand ("on-demand"), false if disabled

(name string)

Source from the content-addressed store, hash-verified

454// Returns false if not specified (default behavior - integrations are disabled by default)
455// For compliance, returns true if enabled (true) or on-demand ("on-demand"), false if disabled
456func (m *Manager) IsIntegrationEnabled(name string) bool {
457 if m.config.Integrations == nil {
458 return false
459 }
460 val, exists := m.config.Integrations[name]
461 if !exists {
462 return false
463 }
464
465 // Special handling for compliance (can be false, "on-demand", or true; may be nested)
466 if name == "compliance" {
467 enabledVal := m.getComplianceVal("enabled")
468 if enabledVal == nil {
469 return false
470 }
471 switch v := enabledVal.(type) {
472 case bool:
473 return v
474 case string:
475 return v == "on-demand" || v == "on_demand" || v == "true"
476 default:
477 return false
478 }
479 }
480
481 // For other integrations, expect bool
482 if enabled, ok := val.(bool); ok {
483 return enabled
484 }
485 return false
486}
487
488// SetIntegrationEnabled sets the enabled status for an integration
489// For compliance, use SetComplianceMode() instead for three-state control

Callers 12

runServiceLoopFunction · 0.80
upgradeSSGContentFunction · 0.80
runInstallScannerFunction · 0.80
reportIntegrationStatusFunction · 0.80
refreshDockerInventoryFunction · 0.80
connectOnceFunction · 0.80
toggleIntegrationFunction · 0.80
runDockerImageScanFunction · 0.80
sendIntegrationDataFunction · 0.80

Calls 1

getComplianceValMethod · 0.95

Tested by

no test coverage detected