package app import ( "os" "gopkg.in/yaml.v3" ) type Config struct { Feeds []struct { Name string `yaml:"name"` Channel string `yaml:"channel"` Rhash string `yaml:"rhash"` Url string `yaml:"url"` Cron string `yaml:"cron"` Proxy string `yaml:"proxy"` } `yaml:"feeds"` } func ParseConfig(configPath string) (*Config, error) { cfg, err := os.ReadFile(configPath) if err != nil { return nil, err } c := Config{} err = yaml.Unmarshal(cfg, &c) if err != nil { return nil, err } return &c, nil }