-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
97 lines (86 loc) · 1.79 KB
/
structs.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package main
// Common data structures
// Docker API Parameters
type CreateContainerParam struct {
Hostname string
Domainname string
User string
AttachStdin bool
AttachStdout bool
AttachStderr bool
Tty bool
OpenStdin bool
StdinOnce bool
Env []string
Labels map[string]string
Cmd []string
Entrypoint []string
Image string
Volumes map[string]map[string]interface{}
WorkingDir string
NetworkDisabled bool
ExposedPorts map[string]map[string]interface{}
StopSignal string
HostConfig map[string]interface{}
}
// Docker API Responses
type DockerImage struct {
Id string
ParentId string
RepoTags []string
RepoDigests interface{}
Created int64
Size int64
VirtualSize int64
Labels interface{}
}
type DockerContainer struct {
Id string
Names []string
Image string
ImageID string
Command string
Created int64
State string
Status string
Ports []string
Labels map[string]string
SizeRw int64
SizeRootFs int64
HostConfig map[string]interface{}
}
type DockerInfo map[string]interface{}
// Messages
// docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
// An example message object:
// Message {
// "run"
// RunOptions {
// "rm"
// }
// "hello-world"
// ""
// "echo hello"
// ""
// }
type Message struct {
Dockercmd string
Options Options
Image string
Container string
Cmd []string
}
type Options struct {
Attach []string
Entrypoint []string
Name string
Time int
Volumes bool
Force bool
Remove bool
}
type Result struct {
Id string // container unique id
Name string // container name
Data interface{} // data
}