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.

obs_test.go 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package obs
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. clitypes "gitlink.org.cn/cloudream/storage2/client/types"
  7. cortypes "gitlink.org.cn/cloudream/storage2/coordinator/types"
  8. )
  9. func Test_S2S(t *testing.T) {
  10. Convey("OBS", t, func() {
  11. s2s := S2STransfer{
  12. cred: &cortypes.OBSCred{
  13. Region: "cn-north-4",
  14. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  15. AK: "",
  16. SK: "",
  17. Bucket: "pcm3-bucket3",
  18. ProjectID: "",
  19. },
  20. feat: &cortypes.S2STransferFeature{
  21. TempDir: "s2s",
  22. },
  23. }
  24. newPath, err := s2s.Transfer(context.TODO(), &clitypes.UserSpaceDetail{
  25. UserSpace: clitypes.UserSpace{
  26. Credential: cortypes.OBSCred{
  27. Region: "cn-north-4",
  28. Endpoint: "obs.cn-north-4.myhuaweicloud.com",
  29. AK: "",
  30. SK: "",
  31. Bucket: "pcm2-bucket2",
  32. ProjectID: "",
  33. },
  34. },
  35. Storage: cortypes.Storage{
  36. Type: &cortypes.OBSType{},
  37. },
  38. }, "test_data/test03.txt")
  39. defer s2s.Abort()
  40. So(err, ShouldEqual, nil)
  41. t.Logf("newPath: %s", newPath)
  42. })
  43. }

本项目旨在将云际存储公共基础设施化,使个人及企业可低门槛使用高效的云际存储服务(安装开箱即用云际存储客户端即可,无需关注其他组件的部署),同时支持用户灵活便捷定制云际存储的功能细节。