github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/monitor/internal/windows/config.go (about) 1 // +build windows 2 3 package windowsmonitor 4 5 import "go.aporeto.io/enforcerd/trireme-lib/monitor/extractors" 6 7 // Config is the configuration options to start a CNI monitor 8 type Config struct { 9 EventMetadataExtractor extractors.EventMetadataExtractor 10 Host bool 11 } 12 13 // DefaultConfig provides a default configuration 14 func DefaultConfig(host bool) *Config { 15 return &Config{ 16 EventMetadataExtractor: extractors.DefaultHostMetadataExtractor, 17 Host: host, 18 } 19 } 20 21 // SetupDefaultConfig adds defaults to a partial configuration 22 func SetupDefaultConfig(windowsConfig *Config) *Config { 23 24 defaultConfig := DefaultConfig(windowsConfig.Host) 25 if windowsConfig.EventMetadataExtractor == nil { 26 windowsConfig.EventMetadataExtractor = defaultConfig.EventMetadataExtractor 27 } 28 return windowsConfig 29 }