You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

client.go 603 B

12345678910111213141516171819202122232425
  1. package cloudstorage
  2. import "fmt"
  3. //type ObjectStorageInfo interface {
  4. // NewClient() (ObjectStorageClient, error)
  5. //}
  6. type ObjectStorageClient interface {
  7. InitiateMultipartUpload(objectName string) (string, error)
  8. UploadPart()
  9. CompleteMultipartUpload() (string, error)
  10. AbortMultipartUpload()
  11. Close()
  12. }
  13. func NewObjectStorageClient(info ObjectStorage) (ObjectStorageClient, error) {
  14. switch info.Manufacturer {
  15. case AliCloud:
  16. return NewOSSClient(info), nil
  17. case HuaweiCloud:
  18. return &OBSClient{}, nil
  19. }
  20. return nil, fmt.Errorf("unknown cloud storage manufacturer %s", info.Manufacturer)
  21. }