github.com/zhgqiang/libcompose@v0.4.1-0.20210112080336-bff7ba3690e1/project/project_pull.go (about)

     1  package project
     2  
     3  import (
     4  	"golang.org/x/net/context"
     5  
     6  	"github.com/zhgqiang/libcompose/project/events"
     7  )
     8  
     9  // Pull pulls the specified services (like docker pull).
    10  func (p *Project) Pull(ctx context.Context, services ...string) error {
    11  	return p.forEach(services, wrapperAction(func(wrapper *serviceWrapper, wrappers map[string]*serviceWrapper) {
    12  		wrapper.Do(nil, events.ServicePullStart, events.ServicePull, func(service Service) error {
    13  			return service.Pull(ctx)
    14  		})
    15  	}), nil)
    16  }