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)
| 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. |
| 260 | func 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 | |
| 274 | func (h *s3Handler) CreateDir(path string) error { return nil } |
| 275 | func (h *s3Handler) DirExists(path string) bool { return true } |
no test coverage detected