config.go 380 B

12345678910111213141516171819202122
  1. package camera
  2. import (
  3. "server/utils"
  4. "server/utils/configor"
  5. )
  6. type CameraDevConfig struct {
  7. Ffmpeg string `json:"ffmpeg"`
  8. Rtu []CameraDev `json:"dev"`
  9. }
  10. var cameraDevConfig CameraDevConfig
  11. func LoadCameraDevConfig() error {
  12. var o CameraDevConfig
  13. err := configor.Load(&o, utils.GetPath(0)+"camera.json")
  14. if err == nil {
  15. cameraDevConfig = o
  16. }
  17. return err
  18. }