Start of destination support and some refactoring

This commit is contained in:
2022-07-05 20:43:32 +09:30
parent c1c1fc1866
commit 16d9ac368c
7 changed files with 189 additions and 81 deletions

View File

@@ -104,6 +104,15 @@ func (c *Config) ProfileCalled(name string) *DownloadProfile {
return nil
}
func (c *Config) DestinationCalled(name string) *Destination {
for _, p := range c.Destinations {
if p.Name == name {
return &p
}
}
return nil
}
func (c *Config) UpdateFromJSON(j []byte) error {
newConfig := Config{}
err := json.Unmarshal(j, &newConfig)