MCPcopy
hub / github.com/minio/minio-go / AddQueue

Method AddQueue

pkg/notification/notification.go:306–327  ·  view source on GitHub ↗

AddQueue adds a given queue config to the general bucket notification config

(queueConfig Config)

Source from the content-addressed store, hash-verified

304
305// AddQueue adds a given queue config to the general bucket notification config
306func (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
330func (b *Configuration) AddLambda(lambdaConfig Config) bool {

Callers 2

testBucketNotificationFunction · 0.95
mainFunction · 0.95

Calls 5

AddMethod · 0.95
IntersectionMethod · 0.95
NewStringSetFunction · 0.92
StringMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected