MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / ValidateBucket

Method ValidateBucket

x/minioclient.go:161–174  ·  view source on GitHub ↗
(uri *url.URL)

Source from the content-addressed store, hash-verified

159}
160
161func (mc *MinioClient) ValidateBucket(uri *url.URL) (string, string, error) {
162 bucketName, objectPrefix := mc.ParseBucketAndPrefix(uri.Path)
163
164 // verify the requested bucket exists.
165 found, err := mc.BucketExists(context.Background(), bucketName)
166 if err != nil {
167 return "", "", errors.Wrapf(err, "while looking for bucket %s at host %s", bucketName, uri.Host)
168 }
169 if !found {
170 return "", "", errors.Errorf("Bucket was not found: %s", bucketName)
171 }
172
173 return bucketName, objectPrefix, nil
174}

Callers 1

newRemoteExportStorageFunction · 0.95

Calls 2

ParseBucketAndPrefixMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected