()
| 31 | ) |
| 32 | |
| 33 | func main() { |
| 34 | // Note: YOUR-ACCESSKEYID, YOUR-SECRETACCESSKEY and my-bucketname are |
| 35 | // dummy values, please replace them with original values. |
| 36 | |
| 37 | // Requests are always secure (HTTPS) by default. Set secure=false to enable insecure (HTTP) access. |
| 38 | // This boolean value is the last argument for New(). |
| 39 | |
| 40 | // New returns an Amazon S3 compatible client object. API compatibility (v2 or v4) is automatically |
| 41 | // determined based on the Endpoint value. |
| 42 | s3Client, err := minio.New("play.min.io", &minio.Options{ |
| 43 | Creds: credentials.NewStaticV4("YOUR-ACCESSKEYID", "YOUR-SECRETACCESSKEY", ""), |
| 44 | Secure: true, |
| 45 | }) |
| 46 | if err != nil { |
| 47 | log.Fatalln(err) |
| 48 | } |
| 49 | |
| 50 | s3Client.TraceOn(os.Stderr) |
| 51 | |
| 52 | // Get replication metrics for a bucket |
| 53 | m, err := s3Client.GetBucketReplicationMetrics(context.Background(), "bucket") |
| 54 | if err != nil { |
| 55 | log.Fatalln(err) |
| 56 | } |
| 57 | fmt.Println("Replication metrics for my-bucketname:", m) |
| 58 | } |
nothing calls this directly
no test coverage detected