allow to collect logs for a subset of project services

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-12-16 16:58:54 +01:00
parent ba47b3d9d2
commit 056dfb95bc
No known key found for this signature in database
GPG key ID: 9858809D6F8F6E7E
8 changed files with 60 additions and 12 deletions

View file

@ -56,7 +56,7 @@ func (c *composeService) Down(context.Context, string) error {
return errdefs.ErrNotImplemented
}
func (c *composeService) Logs(context.Context, string, compose.LogConsumer) error {
func (c *composeService) Logs(context.Context, string, compose.LogConsumer, compose.LogOptions) error {
return errdefs.ErrNotImplemented
}

View file

@ -39,7 +39,7 @@ type Service interface {
// Down executes the equivalent to a `compose down`
Down(ctx context.Context, projectName string) error
// Logs executes the equivalent to a `compose logs`
Logs(ctx context.Context, projectName string, consumer LogConsumer) error
Logs(ctx context.Context, projectName string, consumer LogConsumer, options LogOptions) error
// Ps executes the equivalent to a `compose ps`
Ps(ctx context.Context, projectName string) ([]ContainerSummary, error)
// List executes the equivalent to a `docker stack ls`
@ -76,6 +76,11 @@ type ServiceStatus struct {
Publishers []PortPublisher
}
// LogOptions defines optional parameters for the `Log` API
type LogOptions struct {
Services []string
}
const (
// STARTING indicates that stack is being deployed
STARTING string = "Starting"