mirror of
https://github.com/vbatts/imgsrv.git
synced 2025-07-05 08:38:30 +00:00
working on a configuration merge
This commit is contained in:
parent
83cf991ef9
commit
80e9381754
2 changed files with 28 additions and 1 deletions
|
@ -40,6 +40,33 @@ func (c *Config) Merge(other *Config) error {
|
||||||
if other == nil {
|
if other == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if other.Server {
|
||||||
|
c.Server = other.Server
|
||||||
|
}
|
||||||
|
if len(other.Ip) > 0 {
|
||||||
|
c.Ip = other.Ip
|
||||||
|
}
|
||||||
|
if len(other.Port) > 0 {
|
||||||
|
c.Port = other.Port
|
||||||
|
}
|
||||||
|
if len(other.Port) > 0 {
|
||||||
|
c.Port = other.Port
|
||||||
|
}
|
||||||
|
if len(other.MongoHost) > 0 {
|
||||||
|
c.MongoHost = other.MongoHost
|
||||||
|
}
|
||||||
|
if len(other.MongoDB) > 0 {
|
||||||
|
c.MongoDB = other.MongoDB
|
||||||
|
}
|
||||||
|
if len(other.MongoUsername) > 0 {
|
||||||
|
c.MongoUsername = other.MongoUsername
|
||||||
|
}
|
||||||
|
if len(other.MongoPassword) > 0 {
|
||||||
|
c.MongoPassword = other.MongoPassword
|
||||||
|
}
|
||||||
|
if len(other.RemoteHost) > 0 {
|
||||||
|
c.RemoteHost = other.RemoteHost
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ func main() {
|
||||||
} else {
|
} else {
|
||||||
log.Println("WARN: you didn't provide any keywords :-(")
|
log.Println("WARN: you didn't provide any keywords :-(")
|
||||||
}
|
}
|
||||||
url, err := url.Parse(DefaultConfig.RemoteHost + "/v/" + queryParams)
|
url, err := url.Parse(DefaultConfig.RemoteHost + "/f/" + queryParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue