-
Notifications
You must be signed in to change notification settings - Fork 1
/
system.go
138 lines (111 loc) · 2.9 KB
/
system.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by lesiw.io/ctrctl. DO NOT EDIT.
package ctrctl
import "os/exec"
type SystemDfOpts struct {
// Base exec.Cmd.
Cmd *exec.Cmd
// Format output using a custom template:
// 'table': Print output in table format with column headers (default).
// 'table TEMPLATE': Print output in table format using the given Go template.
// 'json': Print in JSON format.
// 'TEMPLATE': Print output using the given Go template.
// Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates.
Format string
// Print usage.
Help bool
// Show detailed information on space usage.
Verbose bool
}
// Show docker disk usage.
func SystemDf(opts *SystemDfOpts) (string, error) {
return runCtrCmd(
[]string{"system", "df"},
[]string{},
opts,
0,
)
}
type SystemDialStdioOpts struct {
// Base exec.Cmd.
Cmd *exec.Cmd
// Print usage.
Help bool
}
// Proxy the stdio stream to the daemon connection. Should not be invoked manually.
func SystemDialStdio(opts *SystemDialStdioOpts) (string, error) {
return runCtrCmd(
[]string{"system", "dial-stdio"},
[]string{},
opts,
-1,
)
}
type SystemEventsOpts struct {
// Base exec.Cmd.
Cmd *exec.Cmd
// Filter output based on conditions provided.
Filter string
// Format output using a custom template:
// 'json': Print in JSON format.
// 'TEMPLATE': Print output using the given Go template.
// Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates.
Format string
// Print usage.
Help bool
// Show all events created since timestamp.
Since string
// Stream events until this timestamp.
Until string
}
// Get real time events from the server.
func SystemEvents(opts *SystemEventsOpts) (string, error) {
return runCtrCmd(
[]string{"system", "events"},
[]string{},
opts,
0,
)
}
type SystemInfoOpts struct {
// Base exec.Cmd.
Cmd *exec.Cmd
// Format output using a custom template:
// 'json': Print in JSON format.
// 'TEMPLATE': Print output using the given Go template.
// Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates.
Format string
// Print usage.
Help bool
}
// Display system-wide information.
func SystemInfo(opts *SystemInfoOpts) (string, error) {
return runCtrCmd(
[]string{"system", "info"},
[]string{},
opts,
0,
)
}
type SystemPruneOpts struct {
// Base exec.Cmd.
Cmd *exec.Cmd
// Remove all unused images not just dangling ones.
All bool
// Provide filter values (e.g. `label=<key>=<value>`).
Filter string
// Do not prompt for confirmation.
Force bool
// Print usage.
Help bool
// Prune anonymous volumes.
Volumes bool
}
// Remove unused data.
func SystemPrune(opts *SystemPruneOpts) (string, error) {
return runCtrCmd(
[]string{"system", "prune"},
[]string{},
opts,
0,
)
}