opensciencegrid / xrootd-monitoring-shoveler

XRootD monitoring flow packet shoveler
Apache License 2.0
2 stars 7 forks source link

Always read config from config struct #50

Closed haoming29 closed 7 months ago

haoming29 commented 7 months ago

Currently, all but queue.go and map.go read viper parameters through Config struct which was initialized by Config.ReadConfig(). In queue.go, it reads queue_directory directly via viper. In map.go, it reads map and map.all and store them in a local variable.

This makes integration of shoveler into other system (like Pelican) difficult as it didn't consistently read the configuration.

To fix, now all the sub-functions are reading a single Config struct which is still initialized in Config.ReadConfig()

haoming29 commented 7 months ago

Looks good. At some point, should we just have config be a global object? It's just passed around everywhere!

Agree. Things start to get nested now.