yunion.io/x/cloudmux@v0.3.10-0-alpha.1/pkg/multicloud/remotefile/bucket.go (about)

     1  // Copyright 2019 Yunion
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package remotefile
    16  
    17  import (
    18  	"context"
    19  	"io"
    20  	"net/http"
    21  	"time"
    22  
    23  	"yunion.io/x/cloudmux/pkg/cloudprovider"
    24  )
    25  
    26  type SBucket struct {
    27  	SResourceBase
    28  
    29  	region *SRegion
    30  
    31  	RegionId     string
    32  	MaxPart      int
    33  	MaxPartBytes int64
    34  	Acl          string
    35  	Location     string
    36  	StorageClass string
    37  	AccessUrls   []cloudprovider.SBucketAccessUrl
    38  
    39  	Stats cloudprovider.SBucketStats
    40  	Limit cloudprovider.SBucketStats
    41  }
    42  
    43  func (self *SBucket) MaxPartCount() int {
    44  	return self.MaxPart
    45  }
    46  
    47  func (self *SBucket) MaxPartSizeBytes() int64 {
    48  	return self.MaxPartBytes
    49  }
    50  
    51  func (self *SBucket) GetAcl() cloudprovider.TBucketACLType {
    52  	return cloudprovider.TBucketACLType(self.Acl)
    53  }
    54  
    55  func (self *SBucket) GetLocation() string {
    56  	return self.Location
    57  }
    58  
    59  func (self *SBucket) GetIRegion() cloudprovider.ICloudRegion {
    60  	return self.region
    61  }
    62  
    63  func (self *SBucket) GetStorageClass() string {
    64  	return self.StorageClass
    65  }
    66  
    67  func (self *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
    68  	return self.AccessUrls
    69  }
    70  
    71  func (self *SBucket) GetStats() cloudprovider.SBucketStats {
    72  	return self.Stats
    73  }
    74  
    75  func (self *SBucket) GetLimit() cloudprovider.SBucketStats {
    76  	return self.Limit
    77  }
    78  
    79  func (self *SBucket) SetLimit(limit cloudprovider.SBucketStats) error {
    80  	return cloudprovider.ErrNotSupported
    81  }
    82  
    83  func (self *SBucket) LimitSupport() cloudprovider.SBucketStats {
    84  	return self.Limit
    85  }
    86  
    87  func (self *SBucket) AbortMultipartUpload(ctx context.Context, key string, uploadId string) error {
    88  	return cloudprovider.ErrNotSupported
    89  }
    90  
    91  func (self *SBucket) SetAcl(acl cloudprovider.TBucketACLType) error {
    92  	return cloudprovider.ErrNotSupported
    93  }
    94  
    95  func (self *SBucket) ListObjects(prefix string, marker string, delimiter string, maxCount int) (cloudprovider.SListObjectResult, error) {
    96  	return cloudprovider.SListObjectResult{}, cloudprovider.ErrNotSupported
    97  }
    98  
    99  func (self *SBucket) CopyObject(ctx context.Context, destKey string, srcBucket, srcKey string, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, meta http.Header) error {
   100  	return cloudprovider.ErrNotSupported
   101  }
   102  
   103  func (self *SBucket) GetObject(ctx context.Context, key string, rangeOpt *cloudprovider.SGetObjectRange) (io.ReadCloser, error) {
   104  	return nil, cloudprovider.ErrNotSupported
   105  }
   106  
   107  func (self *SBucket) DeleteObject(ctx context.Context, keys string) error {
   108  	return cloudprovider.ErrNotSupported
   109  }
   110  
   111  func (self *SBucket) GetTempUrl(method string, key string, expire time.Duration) (string, error) {
   112  	return "", cloudprovider.ErrNotSupported
   113  }
   114  
   115  func (self *SBucket) PutObject(ctx context.Context, key string, input io.Reader, sizeBytes int64, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, meta http.Header) error {
   116  	return cloudprovider.ErrNotSupported
   117  }
   118  
   119  func (self *SBucket) NewMultipartUpload(ctx context.Context, key string, cannedAcl cloudprovider.TBucketACLType, storageClassStr string, meta http.Header) (string, error) {
   120  	return "", cloudprovider.ErrNotSupported
   121  }
   122  
   123  func (self *SBucket) UploadPart(ctx context.Context, key string, uploadId string, partIndex int, input io.Reader, partSize int64, offset, totalSize int64) (string, error) {
   124  	return "", cloudprovider.ErrNotSupported
   125  }
   126  
   127  func (self *SBucket) CopyPart(ctx context.Context, key string, uploadId string, partIndex int, srcBucketName string, srcKey string, srcOffset int64, srcLength int64) (string, error) {
   128  	return "", cloudprovider.ErrNotSupported
   129  }
   130  
   131  func (self *SBucket) CompleteMultipartUpload(ctx context.Context, key string, uploadId string, partEtags []string) error {
   132  	return cloudprovider.ErrNotSupported
   133  }
   134  
   135  func (self *SBucket) SetWebsite(conf cloudprovider.SBucketWebsiteConf) error {
   136  	return cloudprovider.ErrNotSupported
   137  }
   138  
   139  func (self *SBucket) GetWebsiteConf() (cloudprovider.SBucketWebsiteConf, error) {
   140  	return cloudprovider.SBucketWebsiteConf{}, cloudprovider.ErrNotSupported
   141  }
   142  
   143  func (self *SBucket) DeleteWebSiteConf() error {
   144  	return cloudprovider.ErrNotSupported
   145  }
   146  
   147  func (self *SBucket) SetCORS(rules []cloudprovider.SBucketCORSRule) error {
   148  	return cloudprovider.ErrNotSupported
   149  }
   150  
   151  func (self *SBucket) GetCORSRules() ([]cloudprovider.SBucketCORSRule, error) {
   152  	return nil, cloudprovider.ErrNotSupported
   153  }
   154  
   155  func (self *SBucket) DeleteCORS() error {
   156  	return cloudprovider.ErrNotSupported
   157  }
   158  
   159  func (self *SBucket) SetReferer(conf cloudprovider.SBucketRefererConf) error {
   160  	return cloudprovider.ErrNotSupported
   161  }
   162  
   163  func (self *SBucket) GetReferer() (cloudprovider.SBucketRefererConf, error) {
   164  	return cloudprovider.SBucketRefererConf{}, cloudprovider.ErrNotSupported
   165  }
   166  
   167  func (self *SBucket) GetCdnDomains() ([]cloudprovider.SCdnDomain, error) {
   168  	return nil, cloudprovider.ErrNotSupported
   169  }
   170  
   171  func (self *SBucket) GetPolicy() ([]cloudprovider.SBucketPolicyStatement, error) {
   172  	return nil, cloudprovider.ErrNotSupported
   173  }
   174  
   175  func (self *SBucket) SetPolicy(policy cloudprovider.SBucketPolicyStatementInput) error {
   176  	return cloudprovider.ErrNotSupported
   177  }
   178  
   179  func (self *SBucket) DeletePolicy(id []string) ([]cloudprovider.SBucketPolicyStatement, error) {
   180  	return nil, cloudprovider.ErrNotSupported
   181  }
   182  
   183  func (self *SBucket) ListMultipartUploads() ([]cloudprovider.SBucketMultipartUploads, error) {
   184  	return nil, cloudprovider.ErrNotSupported
   185  }