b7daa2f3a4
Update traefik dependencies (docker/docker and related) - Update dependencies - Fix compilation problems - Remove vdemeester/docker-events (in docker api now) - Remove `integration/vendor` - Use `testImport` - update some deps. - regenerate the lock from scratch (after a `glide cc`)
24 lines
604 B
Go
24 lines
604 B
Go
package project
|
|
|
|
import (
|
|
"golang.org/x/net/context"
|
|
|
|
"github.com/docker/libcompose/project/events"
|
|
)
|
|
|
|
// Events listen for real time events from containers (of the project).
|
|
func (p *Project) Events(ctx context.Context, services ...string) (chan events.ContainerEvent, error) {
|
|
events := make(chan events.ContainerEvent)
|
|
if len(services) == 0 {
|
|
services = p.ServiceConfigs.Keys()
|
|
}
|
|
// FIXME(vdemeester) handle errors (chan) here
|
|
for _, service := range services {
|
|
s, err := p.CreateService(service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
go s.Events(ctx, events)
|
|
}
|
|
return events, nil
|
|
}
|