package config

import (
	"gopkg.in/yaml.v3"
	"os"
)

// ParseCamerasYAML parses camera links from YAML file into struct Cameras.
func ParseCamerasYAML() (map[string]string, error) {
	var CamerasYAML map[string]string

	data, err := os.ReadFile(Cameras)
	if err != nil {
		return CamerasYAML, err
	}

	err = yaml.Unmarshal(data, &CamerasYAML)
	if err != nil {
		return CamerasYAML, err
	}

	return CamerasYAML, nil
}
