traefik/vendor/github.com/docker/libcompose/project/project_events.go
Vincent Demeester b7daa2f3a4 Update traefik dependencies (docker/docker and related) (#1823)
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`)
2017-07-06 16:28:13 +02:00

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
}