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.0 kB

123456789101112131415161718192021222324252627282930313233343536
  1. package config
  2. import (
  3. "gitlink.org.cn/cloudream/common/pkgs/distlock"
  4. log "gitlink.org.cn/cloudream/common/pkgs/logger"
  5. "gitlink.org.cn/cloudream/common/pkgs/mq"
  6. c "gitlink.org.cn/cloudream/common/utils/config"
  7. stgglb "gitlink.org.cn/cloudream/jcs-pub/common/globals"
  8. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/connectivity"
  9. "gitlink.org.cn/cloudream/jcs-pub/common/pkgs/grpc"
  10. cortypes "gitlink.org.cn/cloudream/jcs-pub/coordinator/types"
  11. )
  12. type Config struct {
  13. ID cortypes.HubID `json:"id"`
  14. Local stgglb.LocalMachineInfo `json:"local"`
  15. GRPC *grpc.Config `json:"grpc"`
  16. Logger log.Config `json:"logger"`
  17. RabbitMQ mq.Config `json:"rabbitMQ"`
  18. DistLock distlock.Config `json:"distlock"`
  19. Connectivity connectivity.Config `json:"connectivity"`
  20. }
  21. var cfg Config
  22. func Init(path string) error {
  23. if path == "" {
  24. return c.DefaultLoad("hub", &cfg)
  25. }
  26. return c.Load(path, &cfg)
  27. }
  28. func Cfg() *Config {
  29. return &cfg
  30. }

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