Event refactor

This commit is contained in:
Jonathan Leibiusky @xetorthio
2017-07-18 10:45:05 -03:00
parent 6eaece99c5
commit 4731d8ec98
17 changed files with 198 additions and 125 deletions

View File

@@ -5,6 +5,7 @@ import (
"time"
"github.com/play-with-docker/play-with-docker/docker"
"github.com/play-with-docker/play-with-docker/event"
"github.com/play-with-docker/play-with-docker/pwd/types"
"github.com/play-with-docker/play-with-docker/storage"
"github.com/prometheus/client_golang/prometheus"
@@ -43,10 +44,10 @@ func init() {
}
type pwd struct {
docker docker.DockerApi
tasks SchedulerApi
broadcast BroadcastApi
storage storage.StorageApi
docker docker.DockerApi
tasks SchedulerApi
event event.EventApi
storage storage.StorageApi
}
type PWDApi interface {
@@ -76,8 +77,8 @@ type PWDApi interface {
ClientClose(client *types.Client)
}
func NewPWD(d docker.DockerApi, t SchedulerApi, b BroadcastApi, s storage.StorageApi) *pwd {
return &pwd{docker: d, tasks: t, broadcast: b, storage: s}
func NewPWD(d docker.DockerApi, t SchedulerApi, e event.EventApi, s storage.StorageApi) *pwd {
return &pwd{docker: d, tasks: t, event: e, storage: s}
}
func (p *pwd) setGauges() {