Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 06b033d

Browse files
committed
Event is way too generic noon
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
1 parent 27d640d commit 06b033d

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

api/compose/api.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type StartOptions struct {
6868
// Attach will attach to container and pipe stdout/stderr to LogConsumer
6969
Attach LogConsumer
7070
// Listener will get notified on container events
71-
Listener Listener
71+
Listener chan ContainerExited
7272
}
7373

7474
// UpOptions group options of the Up API
@@ -188,11 +188,8 @@ type LogConsumer interface {
188188
Status(service, container, message string)
189189
}
190190

191-
// Listener get notified on container Events
192-
type Listener chan Event
193-
194-
// Event let us know a Container exited
195-
type Event struct {
191+
// ContainerExited let us know a Container exited
192+
type ContainerExited struct {
196193
Service string
197194
Status int
198195
}

cli/cmd/compose/up.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func runCreateStart(ctx context.Context, opts upOptions, services []string) erro
151151
}
152152

153153
ctx, cancel := context.WithCancel(ctx)
154-
listener := make(chan compose.Event)
154+
listener := make(chan compose.ContainerExited)
155155
go func() {
156156
var aborting bool
157157
for {

local/compose/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *composeService) Start(ctx context.Context, project *types.Project, opti
6464
service := c.Labels[serviceLabel]
6565
options.Attach.Status(service, getCanonicalContainerName(c), fmt.Sprintf("exited with code %d", status.StatusCode))
6666
if options.Listener != nil {
67-
options.Listener <- compose.Event{
67+
options.Listener <- compose.ContainerExited{
6868
Service: service,
6969
Status: int(status.StatusCode),
7070
}

0 commit comments

Comments
 (0)