diff --git a/container/backend/backend.go b/container/backend/backend.go index a768e32..9f92840 100644 --- a/container/backend/backend.go +++ b/container/backend/backend.go @@ -13,7 +13,7 @@ import ( type Backend interface { Monitor(eventsChan chan<- event.Event, errChan chan<- error) - Exec(actionsChan chan<- action.Action, errChan chan<- error) + Exec(actionsChan <-chan action.Action, errChan chan<- error) } func NewBackend(name string, c config.BackendConfig) (Backend, error) { diff --git a/container/backend/docker/docker.go b/container/backend/docker/docker.go index 5d3f0ef..ff01939 100644 --- a/container/backend/docker/docker.go +++ b/container/backend/docker/docker.go @@ -90,6 +90,6 @@ func (d *Docker) Monitor(eventsChan chan<- kevent.Event, errChan chan<- error) { } } -func (d *Docker) Exec(actionsChan chan<- kaction.Action, errChan chan<- error) { +func (d *Docker) Exec(actionsChan <-chan kaction.Action, errChan chan<- error) { log.Debug("[Docker][Exec] Start") } diff --git a/engine/engine.go b/engine/engine.go index 59e29c4..7ae9e95 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -3,16 +3,16 @@ package engine import ( log "github.com/Sirupsen/logrus" "github.com/opsfactory/kappa/container/action" - "github.com/opsfactory/kappa/container/backend" + containerBackend "github.com/opsfactory/kappa/container/backend" "github.com/opsfactory/kappa/container/event" ) type Engine struct { - backend backend.Backend + containerBackend containerBackend.Backend } -func NewEngine(b backend.Backend) *Engine { - return &Engine{backend: b} +func NewEngine(b containerBackend.Backend) *Engine { + return &Engine{containerBackend: b} } func (e Engine) Run() error { @@ -21,8 +21,8 @@ func (e Engine) Run() error { eventsChan := make(chan event.Event) actionsChan := make(chan action.Action) - go e.backend.Monitor(eventsChan, errChan) - go e.backend.Exec(actionsChan, errChan) + go e.containerBackend.Monitor(eventsChan, errChan) + go e.containerBackend.Exec(actionsChan, errChan) go e.handleEvent(eventsChan, actionsChan, errChan) for err := range errChan {