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.

config.go 1.3 kB

2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536
  1. package config
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/distlock"
  4. "gitlink.org.cn/cloudream/common/pkgs/logger"
  5. cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
  6. "gitlink.org.cn/cloudream/common/utils/config"
  7. stgmodels "gitlink.org.cn/cloudream/storage/common/models"
  8. "gitlink.org.cn/cloudream/storage/common/pkgs/connectivity"
  9. "gitlink.org.cn/cloudream/storage/common/pkgs/downloader"
  10. agtrpc "gitlink.org.cn/cloudream/storage/common/pkgs/grpc/agent"
  11. stgmq "gitlink.org.cn/cloudream/storage/common/pkgs/mq"
  12. )
  13. type Config struct {
  14. Local stgmodels.LocalMachineInfo `json:"local"`
  15. AgentGRPC agtrpc.PoolConfig `json:"agentGRPC"`
  16. Logger logger.Config `json:"logger"`
  17. RabbitMQ stgmq.Config `json:"rabbitMQ"`
  18. DistLock distlock.Config `json:"distlock"`
  19. Connectivity connectivity.Config `json:"connectivity"`
  20. Downloader downloader.Config `json:"downloader"`
  21. StorageID cdssdk.StorageID `json:"storageID"` // TODO 进行访问量统计时,当前客户端所属的存储ID。临时解决方案。
  22. }
  23. var cfg Config
  24. // Init 初始化client
  25. // TODO 这里的modeulName参数弄成可配置的更好
  26. func Init() error {
  27. return config.DefaultLoad("client", &cfg)
  28. }
  29. func Cfg() *Config {
  30. return &cfg
  31. }

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