service_factory.go 508 B

1234567891011121314151617
  1. package docker
  2. import (
  3. "github.com/docker/libcompose/config"
  4. "github.com/docker/libcompose/project"
  5. )
  6. // ServiceFactory is an implementation of project.ServiceFactory.
  7. type ServiceFactory struct {
  8. context *Context
  9. }
  10. // Create creates a Service based on the specified project, name and service configuration.
  11. func (s *ServiceFactory) Create(project *project.Project, name string, serviceConfig *config.ServiceConfig) (project.Service, error) {
  12. return NewService(name, serviceConfig, s.context), nil
  13. }