-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
docker.go
54 lines (46 loc) · 1.11 KB
/
docker.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
47
48
49
50
51
52
53
54
package model
import (
"time"
"github.com/docker/docker/api/types/swarm"
)
// ServiceEvent represents attributes of a service event
type ServiceEvent struct {
Service string `mapstructure:"name"`
UpdateState struct {
Old string `mapstructure:"updatestate.old"`
New string `mapstructure:"updatestate.new"`
} `mapstructure:",squash"`
}
// ServiceListArgs are options to list services
type ServiceListArgs struct {
Name string
Labels []string
}
// ServiceInfo represents attributes of a service
type ServiceInfo struct {
Raw swarm.Service
ID string
Name string
Image string
Mode ServiceMode
Labels map[string]string
Actives uint64
Replicas uint64
Rollback bool
UpdatedAt time.Time
UpdateStatus string
}
// ServiceMode is a service mode
type ServiceMode string
// Services modes available
const (
ServiceModeReplicated = ServiceMode("replicated")
ServiceModeGlobal = ServiceMode("global")
)
// TaskInfo represents attributes of a task
type TaskInfo struct {
swarm.Task
NodeName string
ServiceName string
Image string
}