You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.5 KiB
71 lines
2.5 KiB
10 years ago
|
/*
|
||
|
* 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
|
||
|
|
||
10 years ago
|
import "io"
|
||
10 years ago
|
|
||
|
// Collection of Donut specification interfaces
|
||
|
|
||
10 years ago
|
// Interface is a collection of object storage and management interface
|
||
|
type Interface interface {
|
||
10 years ago
|
ObjectStorage
|
||
10 years ago
|
Management
|
||
|
}
|
||
|
|
||
10 years ago
|
// ObjectStorage is a donut object storage interface
|
||
10 years ago
|
type ObjectStorage interface {
|
||
10 years ago
|
// Storage service operations
|
||
10 years ago
|
GetBucketMetadata(bucket string) (BucketMetadata, error)
|
||
10 years ago
|
SetBucketMetadata(bucket string, metadata map[string]string) error
|
||
10 years ago
|
ListBuckets() ([]BucketMetadata, error)
|
||
|
MakeBucket(bucket string, ACL string) error
|
||
10 years ago
|
|
||
10 years ago
|
// Bucket operations
|
||
10 years ago
|
ListObjects(bucket string, resources BucketResourcesMetadata) ([]ObjectMetadata, BucketResourcesMetadata, error)
|
||
10 years ago
|
|
||
10 years ago
|
// Object operations
|
||
10 years ago
|
GetObject(w io.Writer, bucket, object string) (int64, error)
|
||
|
GetPartialObject(w io.Writer, bucket, object string, start, length int64) (int64, error)
|
||
10 years ago
|
GetObjectMetadata(bucket, object string) (ObjectMetadata, error)
|
||
10 years ago
|
CreateObject(bucket, object, expectedMD5Sum string, size int64, reader io.Reader, metadata map[string]string) (ObjectMetadata, error)
|
||
|
|
||
|
Multipart
|
||
|
}
|
||
|
|
||
|
// Multipart API
|
||
|
type Multipart interface {
|
||
|
NewMultipartUpload(bucket, key, contentType string) (string, error)
|
||
|
AbortMultipartUpload(bucket, key, uploadID string) error
|
||
|
CreateObjectPart(bucket, key, uploadID string, partID int, contentType, expectedMD5Sum string, size int64, data io.Reader) (string, error)
|
||
|
CompleteMultipartUpload(bucket, key, uploadID string, parts map[int]string) (ObjectMetadata, error)
|
||
|
ListMultipartUploads(bucket string, resources BucketMultipartResourcesMetadata) (BucketMultipartResourcesMetadata, error)
|
||
|
ListObjectParts(bucket, key string, resources ObjectResourcesMetadata) (ObjectResourcesMetadata, error)
|
||
10 years ago
|
}
|
||
|
|
||
|
// Management is a donut management system interface
|
||
|
type Management interface {
|
||
|
Heal() error
|
||
|
Rebalance() error
|
||
|
Info() (map[string][]string, error)
|
||
|
|
||
10 years ago
|
AttachNode(hostname string, disks []string) error
|
||
|
DetachNode(hostname string) error
|
||
10 years ago
|
|
||
|
SaveConfig() error
|
||
|
LoadConfig() error
|
||
|
}
|