(v *viper.Viper)
| 110 | } |
| 111 | |
| 112 | func (c *EventSourceConfig) initFromViper(v *viper.Viper) { |
| 113 | c.EnableThreadEvents = v.GetBool(enableThreadEvents) |
| 114 | c.EnableRegistryEvents = v.GetBool(enableRegistryEvents) |
| 115 | c.EnableNetEvents = v.GetBool(enableNetEvents) |
| 116 | c.EnableFileIOEvents = v.GetBool(enableFileIOEvents) |
| 117 | c.EnableVAMapEvents = v.GetBool(enableVAMapEvents) |
| 118 | c.EnableModuleEvents = v.GetBool(enableModuleEvents) |
| 119 | c.EnableHandleEvents = v.GetBool(enableHandleEvents) |
| 120 | c.EnableMemEvents = v.GetBool(enableMemEvents) |
| 121 | c.EnableAuditAPIEvents = v.GetBool(enableAuditAPIEvents) |
| 122 | c.EnableDNSEvents = v.GetBool(enableDNSEvents) |
| 123 | c.EnableThreadpoolEvents = v.GetBool(enableThreadpoolEvents) |
| 124 | c.StackEnrichment = v.GetBool(stackEnrichment) |
| 125 | c.BufferSize = uint32(v.GetInt(bufferSize)) |
| 126 | c.MinBuffers = uint32(v.GetInt(minBuffers)) |
| 127 | c.MaxBuffers = uint32(v.GetInt(maxBuffers)) |
| 128 | c.FlushTimer = v.GetDuration(flushInterval) |
| 129 | c.ExcludedEvents = v.GetStringSlice(excludedEvents) |
| 130 | c.ExcludedImages = v.GetStringSlice(excludedImages) |
| 131 | |
| 132 | c.dropMasks = bitmask.New() |
| 133 | c.allMasks = bitmask.New() |
| 134 | |
| 135 | c.excludedImages = make(map[string]bool) |
| 136 | |
| 137 | for _, name := range c.ExcludedEvents { |
| 138 | if typ := event.NameToType(name); typ != event.UnknownType { |
| 139 | c.dropMasks.Set(typ.ID()) |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | for _, typ := range event.AllWithState() { |
| 144 | c.allMasks.Set(typ.ID()) |
| 145 | } |
| 146 | |
| 147 | for _, name := range c.ExcludedImages { |
| 148 | c.excludedImages[name] = true |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | // Init is an exported method to allow initializing exclusion maps from external modules. |
| 153 | func (c *EventSourceConfig) Init() { |
nothing calls this directly
no test coverage detected