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.

main.go 1.6 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package main
  2. import (
  3. "fmt"
  4. "os"
  5. _ "google.golang.org/grpc/balancer/grpclb"
  6. "gitlink.org.cn/cloudream/client/internal/cmdline"
  7. "gitlink.org.cn/cloudream/client/internal/config"
  8. "gitlink.org.cn/cloudream/client/internal/services"
  9. coorcli "gitlink.org.cn/cloudream/rabbitmq/client/coordinator"
  10. )
  11. func main() {
  12. err := config.Init()
  13. if err != nil {
  14. fmt.Printf("init config failed, err: %s", err.Error())
  15. os.Exit(1)
  16. }
  17. coorClient, err := coorcli.NewCoordinatorClient(&config.Cfg().RabbitMQ)
  18. if err != nil {
  19. fmt.Printf("new coordinator client failed, err: %s", err.Error())
  20. os.Exit(1)
  21. }
  22. svc, err := services.NewService(coorClient)
  23. if err != nil {
  24. fmt.Printf("new services failed, err: %s", err.Error())
  25. os.Exit(1)
  26. }
  27. cmds, err := cmdline.NewCommandline(svc)
  28. if err != nil {
  29. fmt.Printf("new command line failed, err: %s", err.Error())
  30. os.Exit(1)
  31. }
  32. args := os.Args
  33. cmds.DispatchCommand(args[1], args[2:])
  34. /*
  35. TO DO future:
  36. 1. ls命令,显示用户指定桶下的所有对象,及相关的元数据
  37. 2. rm命令,用户指定bucket和object名,执行删除操作
  38. 3. update命令,用户发起对象更新命令,查询元数据,判断对象的冗余方式,删除旧对象(unpin所有的副本或编码块),写入新对象
  39. 4. ipfsStat命令,查看本地有无ipfsdaemon,ipfs目录的使用率
  40. 5. ipfsFlush命令,unpin本地ipfs目录中的所有cid(block)
  41. 6. 改为交互式client,输入用户名及秘钥后进入交互界面
  42. 7. 支持纯缓存类型的IPFS节点,数据一律存在后端存储服务中
  43. */
  44. }

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