/
mock.go
44 lines (36 loc) · 913 Bytes
/
mock.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
package deployer
// Mock implements a mock deployment mechanism
type Mock struct {
serviceCount int
}
// NewMock creates a new instance of the Mock deployer that will deploy
// the given container
func NewMock() *Mock {
return &Mock{
serviceCount: 0,
}
}
// Increase the number of services deployed
func (dep *Mock) Increase() error {
dep.serviceCount++
return nil
}
// Decrease the number of services deployed
func (dep *Mock) Decrease() error {
dep.serviceCount--
return nil
}
// RemoveAll removes all the services from deployment
func (dep *Mock) RemoveAll() error {
dep.serviceCount = 0
return nil
}
// Count returns the amount of services deployed
func (dep *Mock) Count() (int, error) {
return dep.serviceCount, nil
}
// IsDeploying returns true while an increase or decrease of services have
// been requested but not completed yet
func (dep *Mock) IsDeploying() bool {
return false
}