-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
euforia
committed
Jul 20, 2018
1 parent
2c4a374
commit 3017d0b
Showing
18 changed files
with
399 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package config | ||
|
||
// OrchestratorConfig holds oconfigurations for a orchestration | ||
type OrchestratorConfig struct { | ||
ID string `hcl:"id" hcle:"omit"` | ||
Addr string `hcl:"addr" hcle:"omitempty"` | ||
} | ||
|
||
// Clone returns a copy of the config | ||
func (conf *OrchestratorConfig) Clone() *OrchestratorConfig { | ||
if conf == nil { | ||
return nil | ||
} | ||
return &OrchestratorConfig{ | ||
ID: conf.ID, | ||
Addr: conf.Addr, | ||
} | ||
} | ||
|
||
// Merge merges the other config into the one. Only non-empty fields are | ||
// considered | ||
func (conf *OrchestratorConfig) Merge(other *OrchestratorConfig) { | ||
if other == nil { | ||
return | ||
} | ||
|
||
if other.ID != "" { | ||
conf.ID = other.ID | ||
} | ||
|
||
if other.Addr != "" { | ||
conf.Addr = other.Addr | ||
} | ||
} |
Oops, something went wrong.