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

Function main

examples/minio/getbucketreplicationmetrics.go:33–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31)
32
33func 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}

Callers

nothing calls this directly

Calls 3

NewStaticV4Function · 0.92
TraceOnMethod · 0.80

Tested by

no test coverage detected