lib: Refactor instantiation of world API
This commit is contained in:
12
lib/main.go
12
lib/main.go
@@ -349,15 +349,17 @@ func (obj *Main) Run() error {
|
|||||||
converger.SetStateFn(convergerStateFn)
|
converger.SetStateFn(convergerStateFn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// implementation of the World API (alternates can be substituted in)
|
||||||
|
world := &etcd.World{
|
||||||
|
Hostname: hostname,
|
||||||
|
EmbdEtcd: EmbdEtcd,
|
||||||
|
}
|
||||||
|
|
||||||
var gapiChan chan error // stream events are nil errors
|
var gapiChan chan error // stream events are nil errors
|
||||||
if obj.GAPI != nil {
|
if obj.GAPI != nil {
|
||||||
data := gapi.Data{
|
data := gapi.Data{
|
||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
// NOTE: alternate implementations can be substituted in
|
World: world,
|
||||||
World: &etcd.World{
|
|
||||||
Hostname: hostname,
|
|
||||||
EmbdEtcd: EmbdEtcd,
|
|
||||||
},
|
|
||||||
Noop: obj.Noop,
|
Noop: obj.Noop,
|
||||||
NoWatch: obj.NoWatch,
|
NoWatch: obj.NoWatch,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user