2015-04-05 10:53:41 +02:00
|
|
|
/*
|
|
|
|
* Minimalist Object Storage, (C) 2015 Minio, Inc.
|
|
|
|
*
|
|
|
|
* 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-04-09 01:28:14 +02:00
|
|
|
// Donut is a collection of object storage and management interface
|
2015-04-05 10:53:41 +02:00
|
|
|
type Donut interface {
|
2015-04-07 06:42:54 +02:00
|
|
|
ObjectStorage
|
2015-04-05 10:53:41 +02:00
|
|
|
Management
|
|
|
|
}
|
|
|
|
|
2015-04-09 01:28:14 +02:00
|
|
|
// ObjectStorage is a donut object storage interface
|
2015-04-07 06:42:54 +02:00
|
|
|
type ObjectStorage interface {
|
2015-06-25 04:43:38 +02:00
|
|
|
// Storage service operations
|
2015-06-27 00:32:24 +02:00
|
|
|
GetBucketMetadata(bucket string) (BucketMetadata, error)
|
2015-04-07 06:42:54 +02:00
|
|
|
SetBucketMetadata(bucket string, metadata map[string]string) error
|
2015-06-27 00:32:24 +02:00
|
|
|
ListBuckets() (map[string]BucketMetadata, error)
|
2015-04-23 03:19:53 +02:00
|
|
|
MakeBucket(bucket, acl string) error
|
2015-04-07 06:42:54 +02:00
|
|
|
|
2015-06-25 04:43:38 +02:00
|
|
|
// Bucket operations
|
|
|
|
ListObjects(bucket, prefix, marker, delim string, maxKeys int) (objects []string, prefixes []string, isTruncated bool, err error)
|
2015-04-07 06:42:54 +02:00
|
|
|
|
2015-06-25 04:43:38 +02:00
|
|
|
// Object operations
|
2015-04-07 06:42:54 +02:00
|
|
|
GetObject(bucket, object string) (io.ReadCloser, int64, error)
|
2015-06-27 02:54:19 +02:00
|
|
|
GetObjectMetadata(bucket, object string) (ObjectMetadata, map[string]string, error)
|
2015-04-30 12:38:11 +02:00
|
|
|
PutObject(bucket, object, expectedMD5Sum string, reader io.ReadCloser, metadata map[string]string) (string, 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
|
|
|
|
|
|
|
SaveConfig() error
|
|
|
|
LoadConfig() error
|
|
|
|
}
|