forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manager_factory.go
42 lines (37 loc) · 1.03 KB
/
manager_factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package instance
import (
biblobstore "github.com/cloudfoundry/bosh-cli/blobstore"
bicloud "github.com/cloudfoundry/bosh-cli/cloud"
bisshtunnel "github.com/cloudfoundry/bosh-cli/deployment/sshtunnel"
bivm "github.com/cloudfoundry/bosh-cli/deployment/vm"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
)
type ManagerFactory interface {
NewManager(bicloud.Cloud, bivm.Manager, biblobstore.Blobstore) Manager
}
type managerFactory struct {
sshTunnelFactory bisshtunnel.Factory
instanceFactory Factory
logger boshlog.Logger
}
func NewManagerFactory(
sshTunnelFactory bisshtunnel.Factory,
instanceFactory Factory,
logger boshlog.Logger,
) ManagerFactory {
return &managerFactory{
sshTunnelFactory: sshTunnelFactory,
instanceFactory: instanceFactory,
logger: logger,
}
}
func (f *managerFactory) NewManager(cloud bicloud.Cloud, vmManager bivm.Manager, blobstore biblobstore.Blobstore) Manager {
return NewManager(
cloud,
vmManager,
blobstore,
f.sshTunnelFactory,
f.instanceFactory,
f.logger,
)
}