AddQueue adds a given queue config to the general bucket notification config
(queueConfig Config)
| 304 | |
| 305 | // AddQueue adds a given queue config to the general bucket notification config |
| 306 | func (b *Configuration) AddQueue(queueConfig Config) bool { |
| 307 | newQueueConfig := QueueConfig{Config: queueConfig, Queue: queueConfig.Arn.String()} |
| 308 | for _, n := range b.QueueConfigs { |
| 309 | if n.Queue == newQueueConfig.Arn.String() && newQueueConfig.Filter == n.Filter { |
| 310 | existingConfig := set.NewStringSet() |
| 311 | for _, v := range n.Events { |
| 312 | existingConfig.Add(string(v)) |
| 313 | } |
| 314 | |
| 315 | newConfig := set.NewStringSet() |
| 316 | for _, v := range queueConfig.Events { |
| 317 | newConfig.Add(string(v)) |
| 318 | } |
| 319 | |
| 320 | if !newConfig.Intersection(existingConfig).IsEmpty() { |
| 321 | return false |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | b.QueueConfigs = append(b.QueueConfigs, newQueueConfig) |
| 326 | return true |
| 327 | } |
| 328 | |
| 329 | // AddLambda adds a given lambda config to the general bucket notification config |
| 330 | func (b *Configuration) AddLambda(lambdaConfig Config) bool { |
no test coverage detected