2015-04-05 10:53:41 +02:00
|
|
|
/*
|
2015-07-25 02:51:40 +02:00
|
|
|
* Minio Cloud Storage, (C) 2015 Minio, Inc.
|
2015-04-05 10:53:41 +02:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package donut
|
|
|
|
|
2015-06-25 21:55:13 +02:00
|
|
|
import "io"
|
2015-04-05 10:53:41 +02:00
|
|
|
|
|
|
|
// Collection of Donut specification interfaces
|
|
|
|
|
2015-07-25 03:09:53 +02:00
|
|
|
// Interface is a collection of cloud storage and management interface
|
2015-07-03 05:31:22 +02:00
|
|
|
type Interface interface {
|
2015-07-25 03:09:53 +02:00
|
|
|
CloudStorage
|
2015-04-05 10:53:41 +02:00
|
|
|
Management
|
|
|
|
}
|
|
|
|
|
2015-07-25 03:09:53 +02:00
|
|
|
// CloudStorage is a donut cloud storage interface
|
|
|
|
type CloudStorage interface {
|
2015-06-25 04:43:38 +02:00
|
|
|
// Storage service operations
|
2015-07-10 04:34:07 +02:00
|
|
|
GetBucketMetadata(bucket string, signature *Signature) (BucketMetadata, error)
|
|
|
|
SetBucketMetadata(bucket string, metadata map[string]string, signature *Signature) error
|
|
|
|
ListBuckets(signature *Signature) ([]BucketMetadata, error)
|
2015-07-14 18:17:30 +02:00
|
|
|
MakeBucket(bucket string, ACL string, location io.Reader, signature *Signature) error
|
2015-04-07 06:42:54 +02:00
|
|
|
|
2015-06-25 04:43:38 +02:00
|
|
|
// Bucket operations
|
2015-07-10 04:34:07 +02:00
|
|
|
ListObjects(string, BucketResourcesMetadata, *Signature) ([]ObjectMetadata, BucketResourcesMetadata, error)
|
2015-04-07 06:42:54 +02:00
|
|
|
|
2015-06-25 04:43:38 +02:00
|
|
|
// Object operations
|
2015-07-29 04:33:56 +02:00
|
|
|
GetObject(w io.Writer, bucket, object string, start, length int64) (int64, error)
|
2015-07-10 04:34:07 +02:00
|
|
|
GetObjectMetadata(bucket, object string, signature *Signature) (ObjectMetadata, error)
|
2015-07-09 23:42:04 +02:00
|
|
|
// bucket, object, expectedMD5Sum, size, reader, metadata, signature
|
|
|
|
CreateObject(string, string, string, int64, io.Reader, map[string]string, *Signature) (ObjectMetadata, error)
|
2015-07-03 05:31:22 +02:00
|
|
|
|
|
|
|
Multipart
|
|
|
|
}
|
|
|
|
|
|
|
|
// Multipart API
|
|
|
|
type Multipart interface {
|
2015-07-10 04:34:07 +02:00
|
|
|
NewMultipartUpload(bucket, key, contentType string, signature *Signature) (string, error)
|
|
|
|
AbortMultipartUpload(bucket, key, uploadID string, signature *Signature) error
|
2015-07-10 04:01:15 +02:00
|
|
|
CreateObjectPart(string, string, string, int, string, string, int64, io.Reader, *Signature) (string, error)
|
|
|
|
CompleteMultipartUpload(bucket, key, uploadID string, data io.Reader, signature *Signature) (ObjectMetadata, error)
|
2015-07-10 04:34:07 +02:00
|
|
|
ListMultipartUploads(string, BucketMultipartResourcesMetadata, *Signature) (BucketMultipartResourcesMetadata, error)
|
|
|
|
ListObjectParts(string, string, ObjectResourcesMetadata, *Signature) (ObjectResourcesMetadata, error)
|
2015-04-05 10:53:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Management is a donut management system interface
|
|
|
|
type Management interface {
|
|
|
|
Heal() error
|
|
|
|
Rebalance() error
|
|
|
|
Info() (map[string][]string, error)
|
|
|
|
|
2015-06-25 21:55:13 +02:00
|
|
|
AttachNode(hostname string, disks []string) error
|
|
|
|
DetachNode(hostname string) error
|
2015-06-25 04:43:38 +02:00
|
|
|
}
|