MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / NewS3Handler

Function NewS3Handler

worker/backup_handler.go:260–272  ·  view source on GitHub ↗

NewS3Handler creates a new session, checks valid bucket at uri.Path, and configures a minio client. It also fills in values used by the handler in subsequent calls. Returns a new S3 minio client, otherwise a nil client with an error.

(uri *url.URL, creds *x.MinioCredentials)

Source from the content-addressed store, hash-verified

258// minio client. It also fills in values used by the handler in subsequent calls.
259// Returns a new S3 minio client, otherwise a nil client with an error.
260func NewS3Handler(uri *url.URL, creds *x.MinioCredentials) (*s3Handler, error) {
261 h := &s3Handler{
262 creds: creds,
263 uri: uri,
264 }
265 mc, err := x.NewMinioClient(uri, creds)
266 if err != nil {
267 return nil, err
268 }
269 h.mc = mc
270 h.bucketName, h.objectPrefix = mc.ParseBucketAndPrefix(uri.Path)
271 return h, nil
272}
273
274func (h *s3Handler) CreateDir(path string) error { return nil }
275func (h *s3Handler) DirExists(path string) bool { return true }

Callers 1

NewUriHandlerFunction · 0.85

Calls 2

ParseBucketAndPrefixMethod · 0.95
NewMinioClientFunction · 0.92

Tested by

no test coverage detected