1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2024-11-27 10:35:41 +00:00

working on a configuration merge

This commit is contained in:
Vincent Batts 2013-08-06 00:27:10 -04:00
parent 83cf991ef9
commit 80e9381754
2 changed files with 28 additions and 1 deletions

View file

@ -40,6 +40,33 @@ func (c *Config) Merge(other *Config) error {
if other == 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
}

View file

@ -86,7 +86,7 @@ func main() {
} else {
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 {
log.Println(err)
return