MCPcopy
hub / github.com/sa7mon/S3Scanner / PrintResult

Function PrintResult

worker/worker.go:13–29  ·  view source on GitHub ↗
(b *bucket.Bucket, json bool)

Source from the content-addressed store, hash-verified

11)
12
13func PrintResult(b *bucket.Bucket, json bool) {
14 if json {
15 log.WithField("bucket", b).Info()
16 return
17 }
18
19 if b.Exists == bucket.BucketNotExist {
20 log.Infof("not_exist | %s", b.Name)
21 return
22 }
23
24 result := fmt.Sprintf("exists | %v | %v | %v", b.Name, b.Region, b.String())
25 if b.ObjectsEnumerated {
26 result = fmt.Sprintf("%v | %v objects (%v)", result, len(b.Objects), humanize.Bytes(b.BucketSize))
27 }
28 log.Info(result)
29}
30
31func Work(wg *sync.WaitGroup, buckets chan bucket.Bucket, provider provider.StorageProvider, doEnumerate bool,
32 writeToDB bool, json bool) {

Callers 3

TestLogsFunction · 0.85
WorkFunction · 0.85
WorkMQFunction · 0.85

Calls 1

StringMethod · 0.80

Tested by 1

TestLogsFunction · 0.68