MCPcopy Create free account
hub / github.com/Juniper/jtimon / GetConfigFiles

Function GetConfigFiles

config.go:208–226  ·  view source on GitHub ↗

GetConfigFiles to get the list of config files

(cfgFile *[]string, cfgFileList string)

Source from the content-addressed store, hash-verified

206
207// GetConfigFiles to get the list of config files
208func GetConfigFiles(cfgFile *[]string, cfgFileList string) error {
209 if len(cfgFileList) != 0 {
210 configfilelist, err := NewJTIMONConfigFilelist(cfgFileList)
211 if err != nil {
212 return fmt.Errorf("%v: [%v]", err, cfgFileList)
213 }
214 n := len(configfilelist.Filenames)
215 if n == 0 {
216 return fmt.Errorf("%s doesn't have any files", cfgFileList)
217 }
218 *cfgFile = configfilelist.Filenames
219 } else {
220 n := len(*cfgFile)
221 if n == 0 {
222 return fmt.Errorf("can not run without any config file")
223 }
224 }
225 return nil
226}
227
228// DecodePassword will decode the password if decoder util is present in the config
229func DecodePassword(jctx *JCtx, config Config) (string, error) {

Callers 8

TestJTISIMSigHupFunction · 0.85
TestJTISIMSigHupChangedFunction · 0.85
TestJTISIMSigIntFunction · 0.85
TestJTISIMRetrySigIntFunction · 0.85
TestPrometheusFunction · 0.85
TestInfluxFunction · 0.85
TestJTISIMMaxRunFunction · 0.85
mainFunction · 0.85

Calls 1

NewJTIMONConfigFilelistFunction · 0.85

Tested by 7

TestJTISIMSigHupFunction · 0.68
TestJTISIMSigHupChangedFunction · 0.68
TestJTISIMSigIntFunction · 0.68
TestJTISIMRetrySigIntFunction · 0.68
TestPrometheusFunction · 0.68
TestInfluxFunction · 0.68
TestJTISIMMaxRunFunction · 0.68