Documentation ¶
Index ¶
- type MockObjectStorage
- func (m *MockObjectStorage) CompleteMultipartUpload(objectKey, uploadID string, totalNumber int) (err error)
- func (m *MockObjectStorage) DeleteObject(objectKey string) (err error)
- func (m *MockObjectStorage) GetObject(objectKey string) (r io.Reader, err error)
- func (m *MockObjectStorage) HeadObject(objectKey string) (om *ObjectMeta, err error)
- func (m *MockObjectStorage) InitiateMultipartUpload(objectKey string) (uploadID string, err error)
- func (m *MockObjectStorage) PutBucket() error
- func (m *MockObjectStorage) SetupBucket(bucketName, zone string) error
- func (m *MockObjectStorage) UploadMultipart(objectKey, uploadID string, size int64, partNumber int, md5sum []byte, ...) (err error)
- type ObjectMeta
- type ObjectStorage
- type QingStorObjectStorage
- func (q *QingStorObjectStorage) CompleteMultipartUpload(objectKey, uploadID string, totalNumber int) (err error)
- func (q *QingStorObjectStorage) DeleteObject(objectKey string) (err error)
- func (q *QingStorObjectStorage) GetObject(objectKey string) (r io.Reader, err error)
- func (q *QingStorObjectStorage) HeadObject(objectKey string) (om *ObjectMeta, err error)
- func (q *QingStorObjectStorage) InitiateMultipartUpload(objectKey string) (uploadID string, err error)
- func (q *QingStorObjectStorage) PutBucket() error
- func (q *QingStorObjectStorage) SetupBucket(name, zone string) (err error)
- func (q *QingStorObjectStorage) UploadMultipart(objectKey, uploadID string, size int64, partNumber int, md5sum []byte, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockObjectStorage ¶
type MockObjectStorage struct {
// contains filtered or unexported fields
}
MockObjectStorage will implement ObjectStorage interface.
func NewMockObjectStorage ¶
func NewMockObjectStorage() *MockObjectStorage
NewMockObjectStorage will create a new mock object storage.
func (*MockObjectStorage) CompleteMultipartUpload ¶
func (m *MockObjectStorage) CompleteMultipartUpload(objectKey, uploadID string, totalNumber int) (err error)
CompleteMultipartUpload implements ObjectStorage.CompleteMultipartUpload
func (*MockObjectStorage) DeleteObject ¶
func (m *MockObjectStorage) DeleteObject(objectKey string) (err error)
DeleteObject implements ObjectStorage.DeleteObject
func (*MockObjectStorage) GetObject ¶
func (m *MockObjectStorage) GetObject(objectKey string) (r io.Reader, err error)
GetObject implements ObjectStorage.GetObject
func (*MockObjectStorage) HeadObject ¶
func (m *MockObjectStorage) HeadObject(objectKey string) (om *ObjectMeta, err error)
HeadObject implements ObjectStorage.HeadObject
func (*MockObjectStorage) InitiateMultipartUpload ¶
func (m *MockObjectStorage) InitiateMultipartUpload(objectKey string) (uploadID string, err error)
InitiateMultipartUpload implements ObjectStorage.InitiateMultipartUpload
func (*MockObjectStorage) PutBucket ¶
func (m *MockObjectStorage) PutBucket() error
PutBucket implements ObjectStorage.PutBucket
func (*MockObjectStorage) SetupBucket ¶
func (m *MockObjectStorage) SetupBucket(bucketName, zone string) error
SetupBucket implements ObjectStorage.SetupBucket
func (*MockObjectStorage) UploadMultipart ¶
func (m *MockObjectStorage) UploadMultipart(objectKey, uploadID string, size int64, partNumber int, md5sum []byte, r io.Reader) (err error)
UploadMultipart implements ObjectStorage.UploadMultipart
type ObjectMeta ¶
type ObjectMeta struct { Key string ContentLength int64 ContentType string ETag string LastModified time.Time StorageClass string }
ObjectMeta is the metadata for an object.
type ObjectStorage ¶
type ObjectStorage interface { SetupBucket(name, zone string) (err error) PutBucket() error DeleteObject(objectKey string) (err error) HeadObject(objectKey string) (om *ObjectMeta, err error) GetObject(objectKey string) (r io.Reader, err error) InitiateMultipartUpload(objectKey string) (uploadID string, err error) UploadMultipart(objectKey, uploadID string, size int64, partNumber int, md5sum []byte, r io.Reader) (err error) CompleteMultipartUpload(objectKey, uploadID string, totalNumber int) (err error) }
ObjectStorage is the interface to communicate with object storage service.
type QingStorObjectStorage ¶
type QingStorObjectStorage struct {
// contains filtered or unexported fields
}
QingStorObjectStorage will implement ObjectStorage interface.
func NewQingStorObjectStorage ¶
func NewQingStorObjectStorage() (q *QingStorObjectStorage, err error)
NewQingStorObjectStorage will create a new qingstor object storage.
func (*QingStorObjectStorage) CompleteMultipartUpload ¶
func (q *QingStorObjectStorage) CompleteMultipartUpload(objectKey, uploadID string, totalNumber int) (err error)
CompleteMultipartUpload will complete a multipart upload.
func (*QingStorObjectStorage) DeleteObject ¶
func (q *QingStorObjectStorage) DeleteObject(objectKey string) (err error)
DeleteObject will delete an object with specific key.
func (*QingStorObjectStorage) GetObject ¶
func (q *QingStorObjectStorage) GetObject(objectKey string) (r io.Reader, err error)
GetObject will get an object.
func (*QingStorObjectStorage) HeadObject ¶
func (q *QingStorObjectStorage) HeadObject(objectKey string) (om *ObjectMeta, err error)
HeadObject will head object.
func (*QingStorObjectStorage) InitiateMultipartUpload ¶
func (q *QingStorObjectStorage) InitiateMultipartUpload(objectKey string) (uploadID string, err error)
InitiateMultipartUpload will initiate a multipart upload.
func (*QingStorObjectStorage) PutBucket ¶
func (q *QingStorObjectStorage) PutBucket() error
PutBucket will make a bucket with specific name.
func (*QingStorObjectStorage) SetupBucket ¶
func (q *QingStorObjectStorage) SetupBucket(name, zone string) (err error)
SetupBucket implements ObjectStorage.SetupBucket
func (*QingStorObjectStorage) UploadMultipart ¶
func (q *QingStorObjectStorage) UploadMultipart( objectKey, uploadID string, size int64, partNumber int, md5sum []byte, r io.Reader, ) (err error)
UploadMultipart will upload a multipart.