diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:22 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:22 -0500 |
commit | 07971ca38143c5faf951d152fba370ddcbe26ad5 (patch) | |
tree | 09af1ef91c782de921efc83113907184c8adecee /vendor/github.com/fsouza/go-dockerclient/misc.go | |
parent | 9b6f05970a001f683b9c886c652de81f00cd5f00 (diff) | |
download | terraform-provider-statuscake-07971ca38143c5faf951d152fba370ddcbe26ad5.tar.gz terraform-provider-statuscake-07971ca38143c5faf951d152fba370ddcbe26ad5.tar.zst terraform-provider-statuscake-07971ca38143c5faf951d152fba370ddcbe26ad5.zip |
deps: use go modules for dep mgmt
run go mod tidy
remove govendor from makefile and travis config
set appropriate env vars for go modules
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/misc.go')
-rw-r--r-- | vendor/github.com/fsouza/go-dockerclient/misc.go | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/misc.go b/vendor/github.com/fsouza/go-dockerclient/misc.go deleted file mode 100644 index ce9e975..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/misc.go +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | // Copyright 2015 go-dockerclient authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | package docker | ||
6 | |||
7 | import ( | ||
8 | "encoding/json" | ||
9 | "strings" | ||
10 | ) | ||
11 | |||
12 | // Version returns version information about the docker server. | ||
13 | // | ||
14 | // See https://goo.gl/ND9R8L for more details. | ||
15 | func (c *Client) Version() (*Env, error) { | ||
16 | resp, err := c.do("GET", "/version", doOptions{}) | ||
17 | if err != nil { | ||
18 | return nil, err | ||
19 | } | ||
20 | defer resp.Body.Close() | ||
21 | var env Env | ||
22 | if err := env.Decode(resp.Body); err != nil { | ||
23 | return nil, err | ||
24 | } | ||
25 | return &env, nil | ||
26 | } | ||
27 | |||
28 | // DockerInfo contains information about the Docker server | ||
29 | // | ||
30 | // See https://goo.gl/bHUoz9 for more details. | ||
31 | type DockerInfo struct { | ||
32 | ID string | ||
33 | Containers int | ||
34 | ContainersRunning int | ||
35 | ContainersPaused int | ||
36 | ContainersStopped int | ||
37 | Images int | ||
38 | Driver string | ||
39 | DriverStatus [][2]string | ||
40 | SystemStatus [][2]string | ||
41 | Plugins PluginsInfo | ||
42 | MemoryLimit bool | ||
43 | SwapLimit bool | ||
44 | KernelMemory bool | ||
45 | CPUCfsPeriod bool `json:"CpuCfsPeriod"` | ||
46 | CPUCfsQuota bool `json:"CpuCfsQuota"` | ||
47 | CPUShares bool | ||
48 | CPUSet bool | ||
49 | IPv4Forwarding bool | ||
50 | BridgeNfIptables bool | ||
51 | BridgeNfIP6tables bool `json:"BridgeNfIp6tables"` | ||
52 | Debug bool | ||
53 | NFd int | ||
54 | OomKillDisable bool | ||
55 | NGoroutines int | ||
56 | SystemTime string | ||
57 | ExecutionDriver string | ||
58 | LoggingDriver string | ||
59 | CgroupDriver string | ||
60 | NEventsListener int | ||
61 | KernelVersion string | ||
62 | OperatingSystem string | ||
63 | OSType string | ||
64 | Architecture string | ||
65 | IndexServerAddress string | ||
66 | NCPU int | ||
67 | MemTotal int64 | ||
68 | DockerRootDir string | ||
69 | HTTPProxy string `json:"HttpProxy"` | ||
70 | HTTPSProxy string `json:"HttpsProxy"` | ||
71 | NoProxy string | ||
72 | Name string | ||
73 | Labels []string | ||
74 | ExperimentalBuild bool | ||
75 | ServerVersion string | ||
76 | ClusterStore string | ||
77 | ClusterAdvertise string | ||
78 | } | ||
79 | |||
80 | // PluginsInfo is a struct with the plugins registered with the docker daemon | ||
81 | // | ||
82 | // for more information, see: https://goo.gl/bHUoz9 | ||
83 | type PluginsInfo struct { | ||
84 | // List of Volume plugins registered | ||
85 | Volume []string | ||
86 | // List of Network plugins registered | ||
87 | Network []string | ||
88 | // List of Authorization plugins registered | ||
89 | Authorization []string | ||
90 | } | ||
91 | |||
92 | // Info returns system-wide information about the Docker server. | ||
93 | // | ||
94 | // See https://goo.gl/ElTHi2 for more details. | ||
95 | func (c *Client) Info() (*DockerInfo, error) { | ||
96 | resp, err := c.do("GET", "/info", doOptions{}) | ||
97 | if err != nil { | ||
98 | return nil, err | ||
99 | } | ||
100 | defer resp.Body.Close() | ||
101 | var info DockerInfo | ||
102 | if err := json.NewDecoder(resp.Body).Decode(&info); err != nil { | ||
103 | return nil, err | ||
104 | } | ||
105 | return &info, nil | ||
106 | } | ||
107 | |||
108 | // ParseRepositoryTag gets the name of the repository and returns it splitted | ||
109 | // in two parts: the repository and the tag. | ||
110 | // | ||
111 | // Some examples: | ||
112 | // | ||
113 | // localhost.localdomain:5000/samalba/hipache:latest -> localhost.localdomain:5000/samalba/hipache, latest | ||
114 | // localhost.localdomain:5000/samalba/hipache -> localhost.localdomain:5000/samalba/hipache, "" | ||
115 | func ParseRepositoryTag(repoTag string) (repository string, tag string) { | ||
116 | n := strings.LastIndex(repoTag, ":") | ||
117 | if n < 0 { | ||
118 | return repoTag, "" | ||
119 | } | ||
120 | if tag := repoTag[n+1:]; !strings.Contains(tag, "/") { | ||
121 | return repoTag[:n], tag | ||
122 | } | ||
123 | return repoTag, "" | ||
124 | } | ||