|
12345678910111213141516171819202122232425262728293031 |
- package config
-
- import (
- "gitlink.org.cn/cloudream/common/pkgs/distlock"
- "gitlink.org.cn/cloudream/common/pkgs/logger"
- "gitlink.org.cn/cloudream/common/utils/config"
- "gitlink.org.cn/cloudream/common/utils/ipfs"
- stgmq "gitlink.org.cn/cloudream/storage-common/pkgs/mq"
- )
-
- type Config struct {
- GRPCPort int `json:"grpcPort"`
- ECPacketSize int64 `json:"ecPacketSize"`
- MaxRepCount int `json:"maxRepCount"`
- LocalIP string `json:"localIP"`
- ExternalIP string `json:"externalIP"`
- Logger logger.Config `json:"logger"`
- RabbitMQ stgmq.Config `json:"rabbitMQ"`
- IPFS *ipfs.Config `json:"ipfs"` // 此字段非空代表客户端上存在ipfs daemon
- DistLock distlock.Config `json:"distlock"`
- }
-
- var cfg Config
-
- func Init() error {
- return config.DefaultLoad("client", &cfg)
- }
-
- func Cfg() *Config {
- return &cfg
- }
|