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

Method makeBucket

api-put-bucket.go:30–44  ·  view source on GitHub ↗

Bucket operations

(ctx context.Context, bucketName string, opts MakeBucketOptions)

Source from the content-addressed store, hash-verified

28
29// Bucket operations
30func (c *Client) makeBucket(ctx context.Context, bucketName string, opts MakeBucketOptions) (err error) {
31 // Validate the input arguments.
32 if err := s3utils.CheckValidBucketNameStrict(bucketName); err != nil {
33 return err
34 }
35
36 err = c.doMakeBucket(ctx, bucketName, opts)
37 if err != nil && (opts.Region == "" || opts.Region == "us-east-1") {
38 if resp, ok := err.(ErrorResponse); ok && resp.Code == AuthorizationHeaderMalformed && resp.Region != "" {
39 opts.Region = resp.Region
40 err = c.doMakeBucket(ctx, bucketName, opts)
41 }
42 }
43 return err
44}
45
46func (c *Client) doMakeBucket(ctx context.Context, bucketName string, opts MakeBucketOptions) (err error) {
47 defer func() {

Callers 1

MakeBucketMethod · 0.95

Calls 2

doMakeBucketMethod · 0.95

Tested by

no test coverage detected