forked from cloudfoundry-attic/bosh-init
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory.go
46 lines (40 loc) · 834 Bytes
/
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
43
44
45
46
package deployment
import (
"time"
bidisk "github.com/cloudfoundry/bosh-init/deployment/disk"
biinstance "github.com/cloudfoundry/bosh-init/deployment/instance"
bistemcell "github.com/cloudfoundry/bosh-init/stemcell"
)
type Factory interface {
NewDeployment(
[]biinstance.Instance,
[]bidisk.Disk,
[]bistemcell.CloudStemcell,
) Deployment
}
type factory struct {
pingTimeout time.Duration
pingDelay time.Duration
}
func NewFactory(
pingTimeout time.Duration,
pingDelay time.Duration,
) Factory {
return &factory{
pingTimeout: pingTimeout,
pingDelay: pingDelay,
}
}
func (f *factory) NewDeployment(
instances []biinstance.Instance,
disks []bidisk.Disk,
stemcells []bistemcell.CloudStemcell,
) Deployment {
return NewDeployment(
instances,
disks,
stemcells,
f.pingTimeout,
f.pingDelay,
)
}