github.com/flatt-online-training/libcompose@v0.4.0/project/project_pause.go (about)

     1  package project
     2  
     3  import (
     4  	"golang.org/x/net/context"
     5  
     6  	"github.com/docker/libcompose/project/events"
     7  )
     8  
     9  // Pause pauses the specified services containers (like docker pause).
    10  func (p *Project) Pause(ctx context.Context, services ...string) error {
    11  	return p.perform(events.ProjectPauseStart, events.ProjectPauseDone, services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) {
    12  		wrapper.Do(nil, events.ServicePauseStart, events.ServicePause, func(service Service) error {
    13  			return service.Pause(ctx)
    14  		})
    15  	}), nil)
    16  }