MCPcopy
hub / github.com/dgraph-io/dgraph / NewUriHandler

Function NewUriHandler

worker/backup_handler.go:137–145  ·  view source on GitHub ↗

NewUriHandler parses the requested URI and finds the corresponding UriHandler. If the passed credentials are not nil, they will be used to override the default credentials (only for backups to minio or S3). Target URI formats: [scheme]://[host]/[path]?[args] [scheme]:///[path]?[args] /[path]?[ar

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

Source from the content-addressed store, hash-verified

135// file:///tmp/dgraph/backups
136// /tmp/dgraph/backups?compress=gzip
137func NewUriHandler(uri *url.URL, creds *x.MinioCredentials) (UriHandler, error) {
138 switch uri.Scheme {
139 case "file", "":
140 return NewFileHandler(uri), nil
141 case "minio", "s3":
142 return NewS3Handler(uri, creds)
143 }
144 return nil, errors.Errorf("Unable to handle url: %s", uri)
145}
146
147// fileHandler is used for 'file:' URI scheme.
148type fileHandler struct {

Callers 9

runExportBackupFunction · 0.92
ProcessBackupRequestFunction · 0.85
WriteBackupMethod · 0.85
CompleteBackupMethod · 0.85
ListBackupManifestsFunction · 0.85
VerifyBackupFunction · 0.85
handleRestoreProposalFunction · 0.85
RunOfflineRestoreFunction · 0.85
RunMapperFunction · 0.85

Calls 3

NewFileHandlerFunction · 0.85
NewS3HandlerFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected