bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/csconfig/cscli.go (about) 1 package csconfig 2 3 /*ccscli specific config, such as hub directory*/ 4 type CscliCfg struct { 5 Output string `yaml:"output,omitempty"` 6 HubBranch string `yaml:"hub_branch"` 7 SimulationConfig *SimulationConfig `yaml:"-"` 8 DbConfig *DatabaseCfg `yaml:"-"` 9 HubDir string `yaml:"-"` 10 DataDir string `yaml:"-"` 11 ConfigDir string `yaml:"-"` 12 HubIndexFile string `yaml:"-"` 13 SimulationFilePath string `yaml:"-"` 14 PrometheusUrl string `yaml:"prometheus_uri"` 15 } 16 17 func (c *Config) LoadCCSCLI() error { 18 if c.Cscli == nil { 19 c.Cscli = &CscliCfg{} 20 } 21 if err := c.LoadConfigurationPaths(); err != nil { 22 return err 23 } 24 c.Cscli.ConfigDir = c.ConfigPaths.ConfigDir 25 c.Cscli.DataDir = c.ConfigPaths.DataDir 26 c.Cscli.HubDir = c.ConfigPaths.HubDir 27 c.Cscli.HubIndexFile = c.ConfigPaths.HubIndexFile 28 29 return nil 30 }