diff options
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units')
9 files changed, 0 insertions, 985 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/CONTRIBUTING.md b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/CONTRIBUTING.md deleted file mode 100644 index 9ea86d7..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/CONTRIBUTING.md +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | # Contributing to go-units | ||
2 | |||
3 | Want to hack on go-units? Awesome! Here are instructions to get you started. | ||
4 | |||
5 | go-units is a part of the [Docker](https://www.docker.com) project, and follows | ||
6 | the same rules and principles. If you're already familiar with the way | ||
7 | Docker does things, you'll feel right at home. | ||
8 | |||
9 | Otherwise, go read Docker's | ||
10 | [contributions guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md), | ||
11 | [issue triaging](https://github.com/docker/docker/blob/master/project/ISSUE-TRIAGE.md), | ||
12 | [review process](https://github.com/docker/docker/blob/master/project/REVIEWING.md) and | ||
13 | [branches and tags](https://github.com/docker/docker/blob/master/project/BRANCHES-AND-TAGS.md). | ||
14 | |||
15 | ### Sign your work | ||
16 | |||
17 | The sign-off is a simple line at the end of the explanation for the patch. Your | ||
18 | signature certifies that you wrote the patch or otherwise have the right to pass | ||
19 | it on as an open-source patch. The rules are pretty simple: if you can certify | ||
20 | the below (from [developercertificate.org](http://developercertificate.org/)): | ||
21 | |||
22 | ``` | ||
23 | Developer Certificate of Origin | ||
24 | Version 1.1 | ||
25 | |||
26 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. | ||
27 | 660 York Street, Suite 102, | ||
28 | San Francisco, CA 94110 USA | ||
29 | |||
30 | Everyone is permitted to copy and distribute verbatim copies of this | ||
31 | license document, but changing it is not allowed. | ||
32 | |||
33 | Developer's Certificate of Origin 1.1 | ||
34 | |||
35 | By making a contribution to this project, I certify that: | ||
36 | |||
37 | (a) The contribution was created in whole or in part by me and I | ||
38 | have the right to submit it under the open source license | ||
39 | indicated in the file; or | ||
40 | |||
41 | (b) The contribution is based upon previous work that, to the best | ||
42 | of my knowledge, is covered under an appropriate open source | ||
43 | license and I have the right under that license to submit that | ||
44 | work with modifications, whether created in whole or in part | ||
45 | by me, under the same open source license (unless I am | ||
46 | permitted to submit under a different license), as indicated | ||
47 | in the file; or | ||
48 | |||
49 | (c) The contribution was provided directly to me by some other | ||
50 | person who certified (a), (b) or (c) and I have not modified | ||
51 | it. | ||
52 | |||
53 | (d) I understand and agree that this project and the contribution | ||
54 | are public and that a record of the contribution (including all | ||
55 | personal information I submit with it, including my sign-off) is | ||
56 | maintained indefinitely and may be redistributed consistent with | ||
57 | this project or the open source license(s) involved. | ||
58 | ``` | ||
59 | |||
60 | Then you just add a line to every git commit message: | ||
61 | |||
62 | Signed-off-by: Joe Smith <joe.smith@email.com> | ||
63 | |||
64 | Use your real name (sorry, no pseudonyms or anonymous contributions.) | ||
65 | |||
66 | If you set your `user.name` and `user.email` git configs, you can sign your | ||
67 | commit automatically with `git commit -s`. | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code deleted file mode 100644 index b55b37b..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.code +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
1 | |||
2 | Apache License | ||
3 | Version 2.0, January 2004 | ||
4 | https://www.apache.org/licenses/ | ||
5 | |||
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
7 | |||
8 | 1. Definitions. | ||
9 | |||
10 | "License" shall mean the terms and conditions for use, reproduction, | ||
11 | and distribution as defined by Sections 1 through 9 of this document. | ||
12 | |||
13 | "Licensor" shall mean the copyright owner or entity authorized by | ||
14 | the copyright owner that is granting the License. | ||
15 | |||
16 | "Legal Entity" shall mean the union of the acting entity and all | ||
17 | other entities that control, are controlled by, or are under common | ||
18 | control with that entity. For the purposes of this definition, | ||
19 | "control" means (i) the power, direct or indirect, to cause the | ||
20 | direction or management of such entity, whether by contract or | ||
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
22 | outstanding shares, or (iii) beneficial ownership of such entity. | ||
23 | |||
24 | "You" (or "Your") shall mean an individual or Legal Entity | ||
25 | exercising permissions granted by this License. | ||
26 | |||
27 | "Source" form shall mean the preferred form for making modifications, | ||
28 | including but not limited to software source code, documentation | ||
29 | source, and configuration files. | ||
30 | |||
31 | "Object" form shall mean any form resulting from mechanical | ||
32 | transformation or translation of a Source form, including but | ||
33 | not limited to compiled object code, generated documentation, | ||
34 | and conversions to other media types. | ||
35 | |||
36 | "Work" shall mean the work of authorship, whether in Source or | ||
37 | Object form, made available under the License, as indicated by a | ||
38 | copyright notice that is included in or attached to the work | ||
39 | (an example is provided in the Appendix below). | ||
40 | |||
41 | "Derivative Works" shall mean any work, whether in Source or Object | ||
42 | form, that is based on (or derived from) the Work and for which the | ||
43 | editorial revisions, annotations, elaborations, or other modifications | ||
44 | represent, as a whole, an original work of authorship. For the purposes | ||
45 | of this License, Derivative Works shall not include works that remain | ||
46 | separable from, or merely link (or bind by name) to the interfaces of, | ||
47 | the Work and Derivative Works thereof. | ||
48 | |||
49 | "Contribution" shall mean any work of authorship, including | ||
50 | the original version of the Work and any modifications or additions | ||
51 | to that Work or Derivative Works thereof, that is intentionally | ||
52 | submitted to Licensor for inclusion in the Work by the copyright owner | ||
53 | or by an individual or Legal Entity authorized to submit on behalf of | ||
54 | the copyright owner. For the purposes of this definition, "submitted" | ||
55 | means any form of electronic, verbal, or written communication sent | ||
56 | to the Licensor or its representatives, including but not limited to | ||
57 | communication on electronic mailing lists, source code control systems, | ||
58 | and issue tracking systems that are managed by, or on behalf of, the | ||
59 | Licensor for the purpose of discussing and improving the Work, but | ||
60 | excluding communication that is conspicuously marked or otherwise | ||
61 | designated in writing by the copyright owner as "Not a Contribution." | ||
62 | |||
63 | "Contributor" shall mean Licensor and any individual or Legal Entity | ||
64 | on behalf of whom a Contribution has been received by Licensor and | ||
65 | subsequently incorporated within the Work. | ||
66 | |||
67 | 2. Grant of Copyright License. Subject to the terms and conditions of | ||
68 | this License, each Contributor hereby grants to You a perpetual, | ||
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
70 | copyright license to reproduce, prepare Derivative Works of, | ||
71 | publicly display, publicly perform, sublicense, and distribute the | ||
72 | Work and such Derivative Works in Source or Object form. | ||
73 | |||
74 | 3. Grant of Patent License. Subject to the terms and conditions of | ||
75 | this License, each Contributor hereby grants to You a perpetual, | ||
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
77 | (except as stated in this section) patent license to make, have made, | ||
78 | use, offer to sell, sell, import, and otherwise transfer the Work, | ||
79 | where such license applies only to those patent claims licensable | ||
80 | by such Contributor that are necessarily infringed by their | ||
81 | Contribution(s) alone or by combination of their Contribution(s) | ||
82 | with the Work to which such Contribution(s) was submitted. If You | ||
83 | institute patent litigation against any entity (including a | ||
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
85 | or a Contribution incorporated within the Work constitutes direct | ||
86 | or contributory patent infringement, then any patent licenses | ||
87 | granted to You under this License for that Work shall terminate | ||
88 | as of the date such litigation is filed. | ||
89 | |||
90 | 4. Redistribution. You may reproduce and distribute copies of the | ||
91 | Work or Derivative Works thereof in any medium, with or without | ||
92 | modifications, and in Source or Object form, provided that You | ||
93 | meet the following conditions: | ||
94 | |||
95 | (a) You must give any other recipients of the Work or | ||
96 | Derivative Works a copy of this License; and | ||
97 | |||
98 | (b) You must cause any modified files to carry prominent notices | ||
99 | stating that You changed the files; and | ||
100 | |||
101 | (c) You must retain, in the Source form of any Derivative Works | ||
102 | that You distribute, all copyright, patent, trademark, and | ||
103 | attribution notices from the Source form of the Work, | ||
104 | excluding those notices that do not pertain to any part of | ||
105 | the Derivative Works; and | ||
106 | |||
107 | (d) If the Work includes a "NOTICE" text file as part of its | ||
108 | distribution, then any Derivative Works that You distribute must | ||
109 | include a readable copy of the attribution notices contained | ||
110 | within such NOTICE file, excluding those notices that do not | ||
111 | pertain to any part of the Derivative Works, in at least one | ||
112 | of the following places: within a NOTICE text file distributed | ||
113 | as part of the Derivative Works; within the Source form or | ||
114 | documentation, if provided along with the Derivative Works; or, | ||
115 | within a display generated by the Derivative Works, if and | ||
116 | wherever such third-party notices normally appear. The contents | ||
117 | of the NOTICE file are for informational purposes only and | ||
118 | do not modify the License. You may add Your own attribution | ||
119 | notices within Derivative Works that You distribute, alongside | ||
120 | or as an addendum to the NOTICE text from the Work, provided | ||
121 | that such additional attribution notices cannot be construed | ||
122 | as modifying the License. | ||
123 | |||
124 | You may add Your own copyright statement to Your modifications and | ||
125 | may provide additional or different license terms and conditions | ||
126 | for use, reproduction, or distribution of Your modifications, or | ||
127 | for any such Derivative Works as a whole, provided Your use, | ||
128 | reproduction, and distribution of the Work otherwise complies with | ||
129 | the conditions stated in this License. | ||
130 | |||
131 | 5. Submission of Contributions. Unless You explicitly state otherwise, | ||
132 | any Contribution intentionally submitted for inclusion in the Work | ||
133 | by You to the Licensor shall be under the terms and conditions of | ||
134 | this License, without any additional terms or conditions. | ||
135 | Notwithstanding the above, nothing herein shall supersede or modify | ||
136 | the terms of any separate license agreement you may have executed | ||
137 | with Licensor regarding such Contributions. | ||
138 | |||
139 | 6. Trademarks. This License does not grant permission to use the trade | ||
140 | names, trademarks, service marks, or product names of the Licensor, | ||
141 | except as required for reasonable and customary use in describing the | ||
142 | origin of the Work and reproducing the content of the NOTICE file. | ||
143 | |||
144 | 7. Disclaimer of Warranty. Unless required by applicable law or | ||
145 | agreed to in writing, Licensor provides the Work (and each | ||
146 | Contributor provides its Contributions) on an "AS IS" BASIS, | ||
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
148 | implied, including, without limitation, any warranties or conditions | ||
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
150 | PARTICULAR PURPOSE. You are solely responsible for determining the | ||
151 | appropriateness of using or redistributing the Work and assume any | ||
152 | risks associated with Your exercise of permissions under this License. | ||
153 | |||
154 | 8. Limitation of Liability. In no event and under no legal theory, | ||
155 | whether in tort (including negligence), contract, or otherwise, | ||
156 | unless required by applicable law (such as deliberate and grossly | ||
157 | negligent acts) or agreed to in writing, shall any Contributor be | ||
158 | liable to You for damages, including any direct, indirect, special, | ||
159 | incidental, or consequential damages of any character arising as a | ||
160 | result of this License or out of the use or inability to use the | ||
161 | Work (including but not limited to damages for loss of goodwill, | ||
162 | work stoppage, computer failure or malfunction, or any and all | ||
163 | other commercial damages or losses), even if such Contributor | ||
164 | has been advised of the possibility of such damages. | ||
165 | |||
166 | 9. Accepting Warranty or Additional Liability. While redistributing | ||
167 | the Work or Derivative Works thereof, You may choose to offer, | ||
168 | and charge a fee for, acceptance of support, warranty, indemnity, | ||
169 | or other liability obligations and/or rights consistent with this | ||
170 | License. However, in accepting such obligations, You may act only | ||
171 | on Your own behalf and on Your sole responsibility, not on behalf | ||
172 | of any other Contributor, and only if You agree to indemnify, | ||
173 | defend, and hold each Contributor harmless for any liability | ||
174 | incurred by, or claims asserted against, such Contributor by reason | ||
175 | of your accepting any such warranty or additional liability. | ||
176 | |||
177 | END OF TERMS AND CONDITIONS | ||
178 | |||
179 | Copyright 2015 Docker, Inc. | ||
180 | |||
181 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
182 | you may not use this file except in compliance with the License. | ||
183 | You may obtain a copy of the License at | ||
184 | |||
185 | https://www.apache.org/licenses/LICENSE-2.0 | ||
186 | |||
187 | Unless required by applicable law or agreed to in writing, software | ||
188 | distributed under the License is distributed on an "AS IS" BASIS, | ||
189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
190 | See the License for the specific language governing permissions and | ||
191 | limitations under the License. | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs deleted file mode 100644 index e26cd4f..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/LICENSE.docs +++ /dev/null | |||
@@ -1,425 +0,0 @@ | |||
1 | Attribution-ShareAlike 4.0 International | ||
2 | |||
3 | ======================================================================= | ||
4 | |||
5 | Creative Commons Corporation ("Creative Commons") is not a law firm and | ||
6 | does not provide legal services or legal advice. Distribution of | ||
7 | Creative Commons public licenses does not create a lawyer-client or | ||
8 | other relationship. Creative Commons makes its licenses and related | ||
9 | information available on an "as-is" basis. Creative Commons gives no | ||
10 | warranties regarding its licenses, any material licensed under their | ||
11 | terms and conditions, or any related information. Creative Commons | ||
12 | disclaims all liability for damages resulting from their use to the | ||
13 | fullest extent possible. | ||
14 | |||
15 | Using Creative Commons Public Licenses | ||
16 | |||
17 | Creative Commons public licenses provide a standard set of terms and | ||
18 | conditions that creators and other rights holders may use to share | ||
19 | original works of authorship and other material subject to copyright | ||
20 | and certain other rights specified in the public license below. The | ||
21 | following considerations are for informational purposes only, are not | ||
22 | exhaustive, and do not form part of our licenses. | ||
23 | |||
24 | Considerations for licensors: Our public licenses are | ||
25 | intended for use by those authorized to give the public | ||
26 | permission to use material in ways otherwise restricted by | ||
27 | copyright and certain other rights. Our licenses are | ||
28 | irrevocable. Licensors should read and understand the terms | ||
29 | and conditions of the license they choose before applying it. | ||
30 | Licensors should also secure all rights necessary before | ||
31 | applying our licenses so that the public can reuse the | ||
32 | material as expected. Licensors should clearly mark any | ||
33 | material not subject to the license. This includes other CC- | ||
34 | licensed material, or material used under an exception or | ||
35 | limitation to copyright. More considerations for licensors: | ||
36 | wiki.creativecommons.org/Considerations_for_licensors | ||
37 | |||
38 | Considerations for the public: By using one of our public | ||
39 | licenses, a licensor grants the public permission to use the | ||
40 | licensed material under specified terms and conditions. If | ||
41 | the licensor's permission is not necessary for any reason--for | ||
42 | example, because of any applicable exception or limitation to | ||
43 | copyright--then that use is not regulated by the license. Our | ||
44 | licenses grant only permissions under copyright and certain | ||
45 | other rights that a licensor has authority to grant. Use of | ||
46 | the licensed material may still be restricted for other | ||
47 | reasons, including because others have copyright or other | ||
48 | rights in the material. A licensor may make special requests, | ||
49 | such as asking that all changes be marked or described. | ||
50 | Although not required by our licenses, you are encouraged to | ||
51 | respect those requests where reasonable. More_considerations | ||
52 | for the public: | ||
53 | wiki.creativecommons.org/Considerations_for_licensees | ||
54 | |||
55 | ======================================================================= | ||
56 | |||
57 | Creative Commons Attribution-ShareAlike 4.0 International Public | ||
58 | License | ||
59 | |||
60 | By exercising the Licensed Rights (defined below), You accept and agree | ||
61 | to be bound by the terms and conditions of this Creative Commons | ||
62 | Attribution-ShareAlike 4.0 International Public License ("Public | ||
63 | License"). To the extent this Public License may be interpreted as a | ||
64 | contract, You are granted the Licensed Rights in consideration of Your | ||
65 | acceptance of these terms and conditions, and the Licensor grants You | ||
66 | such rights in consideration of benefits the Licensor receives from | ||
67 | making the Licensed Material available under these terms and | ||
68 | conditions. | ||
69 | |||
70 | |||
71 | Section 1 -- Definitions. | ||
72 | |||
73 | a. Adapted Material means material subject to Copyright and Similar | ||
74 | Rights that is derived from or based upon the Licensed Material | ||
75 | and in which the Licensed Material is translated, altered, | ||
76 | arranged, transformed, or otherwise modified in a manner requiring | ||
77 | permission under the Copyright and Similar Rights held by the | ||
78 | Licensor. For purposes of this Public License, where the Licensed | ||
79 | Material is a musical work, performance, or sound recording, | ||
80 | Adapted Material is always produced where the Licensed Material is | ||
81 | synched in timed relation with a moving image. | ||
82 | |||
83 | b. Adapter's License means the license You apply to Your Copyright | ||
84 | and Similar Rights in Your contributions to Adapted Material in | ||
85 | accordance with the terms and conditions of this Public License. | ||
86 | |||
87 | c. BY-SA Compatible License means a license listed at | ||
88 | creativecommons.org/compatiblelicenses, approved by Creative | ||
89 | Commons as essentially the equivalent of this Public License. | ||
90 | |||
91 | d. Copyright and Similar Rights means copyright and/or similar rights | ||
92 | closely related to copyright including, without limitation, | ||
93 | performance, broadcast, sound recording, and Sui Generis Database | ||
94 | Rights, without regard to how the rights are labeled or | ||
95 | categorized. For purposes of this Public License, the rights | ||
96 | specified in Section 2(b)(1)-(2) are not Copyright and Similar | ||
97 | Rights. | ||
98 | |||
99 | e. Effective Technological Measures means those measures that, in the | ||
100 | absence of proper authority, may not be circumvented under laws | ||
101 | fulfilling obligations under Article 11 of the WIPO Copyright | ||
102 | Treaty adopted on December 20, 1996, and/or similar international | ||
103 | agreements. | ||
104 | |||
105 | f. Exceptions and Limitations means fair use, fair dealing, and/or | ||
106 | any other exception or limitation to Copyright and Similar Rights | ||
107 | that applies to Your use of the Licensed Material. | ||
108 | |||
109 | g. License Elements means the license attributes listed in the name | ||
110 | of a Creative Commons Public License. The License Elements of this | ||
111 | Public License are Attribution and ShareAlike. | ||
112 | |||
113 | h. Licensed Material means the artistic or literary work, database, | ||
114 | or other material to which the Licensor applied this Public | ||
115 | License. | ||
116 | |||
117 | i. Licensed Rights means the rights granted to You subject to the | ||
118 | terms and conditions of this Public License, which are limited to | ||
119 | all Copyright and Similar Rights that apply to Your use of the | ||
120 | Licensed Material and that the Licensor has authority to license. | ||
121 | |||
122 | j. Licensor means the individual(s) or entity(ies) granting rights | ||
123 | under this Public License. | ||
124 | |||
125 | k. Share means to provide material to the public by any means or | ||
126 | process that requires permission under the Licensed Rights, such | ||
127 | as reproduction, public display, public performance, distribution, | ||
128 | dissemination, communication, or importation, and to make material | ||
129 | available to the public including in ways that members of the | ||
130 | public may access the material from a place and at a time | ||
131 | individually chosen by them. | ||
132 | |||
133 | l. Sui Generis Database Rights means rights other than copyright | ||
134 | resulting from Directive 96/9/EC of the European Parliament and of | ||
135 | the Council of 11 March 1996 on the legal protection of databases, | ||
136 | as amended and/or succeeded, as well as other essentially | ||
137 | equivalent rights anywhere in the world. | ||
138 | |||
139 | m. You means the individual or entity exercising the Licensed Rights | ||
140 | under this Public License. Your has a corresponding meaning. | ||
141 | |||
142 | |||
143 | Section 2 -- Scope. | ||
144 | |||
145 | a. License grant. | ||
146 | |||
147 | 1. Subject to the terms and conditions of this Public License, | ||
148 | the Licensor hereby grants You a worldwide, royalty-free, | ||
149 | non-sublicensable, non-exclusive, irrevocable license to | ||
150 | exercise the Licensed Rights in the Licensed Material to: | ||
151 | |||
152 | a. reproduce and Share the Licensed Material, in whole or | ||
153 | in part; and | ||
154 | |||
155 | b. produce, reproduce, and Share Adapted Material. | ||
156 | |||
157 | 2. Exceptions and Limitations. For the avoidance of doubt, where | ||
158 | Exceptions and Limitations apply to Your use, this Public | ||
159 | License does not apply, and You do not need to comply with | ||
160 | its terms and conditions. | ||
161 | |||
162 | 3. Term. The term of this Public License is specified in Section | ||
163 | 6(a). | ||
164 | |||
165 | 4. Media and formats; technical modifications allowed. The | ||
166 | Licensor authorizes You to exercise the Licensed Rights in | ||
167 | all media and formats whether now known or hereafter created, | ||
168 | and to make technical modifications necessary to do so. The | ||
169 | Licensor waives and/or agrees not to assert any right or | ||
170 | authority to forbid You from making technical modifications | ||
171 | necessary to exercise the Licensed Rights, including | ||
172 | technical modifications necessary to circumvent Effective | ||
173 | Technological Measures. For purposes of this Public License, | ||
174 | simply making modifications authorized by this Section 2(a) | ||
175 | (4) never produces Adapted Material. | ||
176 | |||
177 | 5. Downstream recipients. | ||
178 | |||
179 | a. Offer from the Licensor -- Licensed Material. Every | ||
180 | recipient of the Licensed Material automatically | ||
181 | receives an offer from the Licensor to exercise the | ||
182 | Licensed Rights under the terms and conditions of this | ||
183 | Public License. | ||
184 | |||
185 | b. Additional offer from the Licensor -- Adapted Material. | ||
186 | Every recipient of Adapted Material from You | ||
187 | automatically receives an offer from the Licensor to | ||
188 | exercise the Licensed Rights in the Adapted Material | ||
189 | under the conditions of the Adapter's License You apply. | ||
190 | |||
191 | c. No downstream restrictions. You may not offer or impose | ||
192 | any additional or different terms or conditions on, or | ||
193 | apply any Effective Technological Measures to, the | ||
194 | Licensed Material if doing so restricts exercise of the | ||
195 | Licensed Rights by any recipient of the Licensed | ||
196 | Material. | ||
197 | |||
198 | 6. No endorsement. Nothing in this Public License constitutes or | ||
199 | may be construed as permission to assert or imply that You | ||
200 | are, or that Your use of the Licensed Material is, connected | ||
201 | with, or sponsored, endorsed, or granted official status by, | ||
202 | the Licensor or others designated to receive attribution as | ||
203 | provided in Section 3(a)(1)(A)(i). | ||
204 | |||
205 | b. Other rights. | ||
206 | |||
207 | 1. Moral rights, such as the right of integrity, are not | ||
208 | licensed under this Public License, nor are publicity, | ||
209 | privacy, and/or other similar personality rights; however, to | ||
210 | the extent possible, the Licensor waives and/or agrees not to | ||
211 | assert any such rights held by the Licensor to the limited | ||
212 | extent necessary to allow You to exercise the Licensed | ||
213 | Rights, but not otherwise. | ||
214 | |||
215 | 2. Patent and trademark rights are not licensed under this | ||
216 | Public License. | ||
217 | |||
218 | 3. To the extent possible, the Licensor waives any right to | ||
219 | collect royalties from You for the exercise of the Licensed | ||
220 | Rights, whether directly or through a collecting society | ||
221 | under any voluntary or waivable statutory or compulsory | ||
222 | licensing scheme. In all other cases the Licensor expressly | ||
223 | reserves any right to collect such royalties. | ||
224 | |||
225 | |||
226 | Section 3 -- License Conditions. | ||
227 | |||
228 | Your exercise of the Licensed Rights is expressly made subject to the | ||
229 | following conditions. | ||
230 | |||
231 | a. Attribution. | ||
232 | |||
233 | 1. If You Share the Licensed Material (including in modified | ||
234 | form), You must: | ||
235 | |||
236 | a. retain the following if it is supplied by the Licensor | ||
237 | with the Licensed Material: | ||
238 | |||
239 | i. identification of the creator(s) of the Licensed | ||
240 | Material and any others designated to receive | ||
241 | attribution, in any reasonable manner requested by | ||
242 | the Licensor (including by pseudonym if | ||
243 | designated); | ||
244 | |||
245 | ii. a copyright notice; | ||
246 | |||
247 | iii. a notice that refers to this Public License; | ||
248 | |||
249 | iv. a notice that refers to the disclaimer of | ||
250 | warranties; | ||
251 | |||
252 | v. a URI or hyperlink to the Licensed Material to the | ||
253 | extent reasonably practicable; | ||
254 | |||
255 | b. indicate if You modified the Licensed Material and | ||
256 | retain an indication of any previous modifications; and | ||
257 | |||
258 | c. indicate the Licensed Material is licensed under this | ||
259 | Public License, and include the text of, or the URI or | ||
260 | hyperlink to, this Public License. | ||
261 | |||
262 | 2. You may satisfy the conditions in Section 3(a)(1) in any | ||
263 | reasonable manner based on the medium, means, and context in | ||
264 | which You Share the Licensed Material. For example, it may be | ||
265 | reasonable to satisfy the conditions by providing a URI or | ||
266 | hyperlink to a resource that includes the required | ||
267 | information. | ||
268 | |||
269 | 3. If requested by the Licensor, You must remove any of the | ||
270 | information required by Section 3(a)(1)(A) to the extent | ||
271 | reasonably practicable. | ||
272 | |||
273 | b. ShareAlike. | ||
274 | |||
275 | In addition to the conditions in Section 3(a), if You Share | ||
276 | Adapted Material You produce, the following conditions also apply. | ||
277 | |||
278 | 1. The Adapter's License You apply must be a Creative Commons | ||
279 | license with the same License Elements, this version or | ||
280 | later, or a BY-SA Compatible License. | ||
281 | |||
282 | 2. You must include the text of, or the URI or hyperlink to, the | ||
283 | Adapter's License You apply. You may satisfy this condition | ||
284 | in any reasonable manner based on the medium, means, and | ||
285 | context in which You Share Adapted Material. | ||
286 | |||
287 | 3. You may not offer or impose any additional or different terms | ||
288 | or conditions on, or apply any Effective Technological | ||
289 | Measures to, Adapted Material that restrict exercise of the | ||
290 | rights granted under the Adapter's License You apply. | ||
291 | |||
292 | |||
293 | Section 4 -- Sui Generis Database Rights. | ||
294 | |||
295 | Where the Licensed Rights include Sui Generis Database Rights that | ||
296 | apply to Your use of the Licensed Material: | ||
297 | |||
298 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right | ||
299 | to extract, reuse, reproduce, and Share all or a substantial | ||
300 | portion of the contents of the database; | ||
301 | |||
302 | b. if You include all or a substantial portion of the database | ||
303 | contents in a database in which You have Sui Generis Database | ||
304 | Rights, then the database in which You have Sui Generis Database | ||
305 | Rights (but not its individual contents) is Adapted Material, | ||
306 | |||
307 | including for purposes of Section 3(b); and | ||
308 | c. You must comply with the conditions in Section 3(a) if You Share | ||
309 | all or a substantial portion of the contents of the database. | ||
310 | |||
311 | For the avoidance of doubt, this Section 4 supplements and does not | ||
312 | replace Your obligations under this Public License where the Licensed | ||
313 | Rights include other Copyright and Similar Rights. | ||
314 | |||
315 | |||
316 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. | ||
317 | |||
318 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE | ||
319 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS | ||
320 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF | ||
321 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, | ||
322 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, | ||
323 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
324 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, | ||
325 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT | ||
326 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT | ||
327 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. | ||
328 | |||
329 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE | ||
330 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, | ||
331 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, | ||
332 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, | ||
333 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR | ||
334 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN | ||
335 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR | ||
336 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR | ||
337 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. | ||
338 | |||
339 | c. The disclaimer of warranties and limitation of liability provided | ||
340 | above shall be interpreted in a manner that, to the extent | ||
341 | possible, most closely approximates an absolute disclaimer and | ||
342 | waiver of all liability. | ||
343 | |||
344 | |||
345 | Section 6 -- Term and Termination. | ||
346 | |||
347 | a. This Public License applies for the term of the Copyright and | ||
348 | Similar Rights licensed here. However, if You fail to comply with | ||
349 | this Public License, then Your rights under this Public License | ||
350 | terminate automatically. | ||
351 | |||
352 | b. Where Your right to use the Licensed Material has terminated under | ||
353 | Section 6(a), it reinstates: | ||
354 | |||
355 | 1. automatically as of the date the violation is cured, provided | ||
356 | it is cured within 30 days of Your discovery of the | ||
357 | violation; or | ||
358 | |||
359 | 2. upon express reinstatement by the Licensor. | ||
360 | |||
361 | For the avoidance of doubt, this Section 6(b) does not affect any | ||
362 | right the Licensor may have to seek remedies for Your violations | ||
363 | of this Public License. | ||
364 | |||
365 | c. For the avoidance of doubt, the Licensor may also offer the | ||
366 | Licensed Material under separate terms or conditions or stop | ||
367 | distributing the Licensed Material at any time; however, doing so | ||
368 | will not terminate this Public License. | ||
369 | |||
370 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public | ||
371 | License. | ||
372 | |||
373 | |||
374 | Section 7 -- Other Terms and Conditions. | ||
375 | |||
376 | a. The Licensor shall not be bound by any additional or different | ||
377 | terms or conditions communicated by You unless expressly agreed. | ||
378 | |||
379 | b. Any arrangements, understandings, or agreements regarding the | ||
380 | Licensed Material not stated herein are separate from and | ||
381 | independent of the terms and conditions of this Public License. | ||
382 | |||
383 | |||
384 | Section 8 -- Interpretation. | ||
385 | |||
386 | a. For the avoidance of doubt, this Public License does not, and | ||
387 | shall not be interpreted to, reduce, limit, restrict, or impose | ||
388 | conditions on any use of the Licensed Material that could lawfully | ||
389 | be made without permission under this Public License. | ||
390 | |||
391 | b. To the extent possible, if any provision of this Public License is | ||
392 | deemed unenforceable, it shall be automatically reformed to the | ||
393 | minimum extent necessary to make it enforceable. If the provision | ||
394 | cannot be reformed, it shall be severed from this Public License | ||
395 | without affecting the enforceability of the remaining terms and | ||
396 | conditions. | ||
397 | |||
398 | c. No term or condition of this Public License will be waived and no | ||
399 | failure to comply consented to unless expressly agreed to by the | ||
400 | Licensor. | ||
401 | |||
402 | d. Nothing in this Public License constitutes or may be interpreted | ||
403 | as a limitation upon, or waiver of, any privileges and immunities | ||
404 | that apply to the Licensor or You, including from the legal | ||
405 | processes of any jurisdiction or authority. | ||
406 | |||
407 | |||
408 | ======================================================================= | ||
409 | |||
410 | Creative Commons is not a party to its public licenses. | ||
411 | Notwithstanding, Creative Commons may elect to apply one of its public | ||
412 | licenses to material it publishes and in those instances will be | ||
413 | considered the "Licensor." Except for the limited purpose of indicating | ||
414 | that material is shared under a Creative Commons public license or as | ||
415 | otherwise permitted by the Creative Commons policies published at | ||
416 | creativecommons.org/policies, Creative Commons does not authorize the | ||
417 | use of the trademark "Creative Commons" or any other trademark or logo | ||
418 | of Creative Commons without its prior written consent including, | ||
419 | without limitation, in connection with any unauthorized modifications | ||
420 | to any of its public licenses or any other arrangements, | ||
421 | understandings, or agreements concerning use of licensed material. For | ||
422 | the avoidance of doubt, this paragraph does not form part of the public | ||
423 | licenses. | ||
424 | |||
425 | Creative Commons may be contacted at creativecommons.org. | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/MAINTAINERS b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/MAINTAINERS deleted file mode 100644 index 477be8b..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/MAINTAINERS +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | # go-connections maintainers file | ||
2 | # | ||
3 | # This file describes who runs the docker/go-connections project and how. | ||
4 | # This is a living document - if you see something out of date or missing, speak up! | ||
5 | # | ||
6 | # It is structured to be consumable by both humans and programs. | ||
7 | # To extract its contents programmatically, use any TOML-compliant parser. | ||
8 | # | ||
9 | # This file is compiled into the MAINTAINERS file in docker/opensource. | ||
10 | # | ||
11 | [Org] | ||
12 | [Org."Core maintainers"] | ||
13 | people = [ | ||
14 | "calavera", | ||
15 | ] | ||
16 | |||
17 | [people] | ||
18 | |||
19 | # A reference list of all people associated with the project. | ||
20 | # All other sections should refer to people by their canonical key | ||
21 | # in the people section. | ||
22 | |||
23 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER | ||
24 | [people.calavera] | ||
25 | Name = "David Calavera" | ||
26 | Email = "david.calavera@gmail.com" | ||
27 | GitHub = "calavera" | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/README.md b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/README.md deleted file mode 100644 index 3ce4d79..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/README.md +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) | ||
2 | |||
3 | # Introduction | ||
4 | |||
5 | go-units is a library to transform human friendly measurements into machine friendly values. | ||
6 | |||
7 | ## Usage | ||
8 | |||
9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. | ||
10 | |||
11 | ## Copyright and license | ||
12 | |||
13 | Copyright © 2015 Docker, Inc. All rights reserved, except as follows. Code | ||
14 | is released under the Apache 2.0 license. The README.md file, and files in the | ||
15 | "docs" folder are licensed under the Creative Commons Attribution 4.0 | ||
16 | International License under the terms and conditions set forth in the file | ||
17 | "LICENSE.docs". You may obtain a duplicate copy of the same license, titled | ||
18 | CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/. | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/circle.yml b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/circle.yml deleted file mode 100644 index 9043b35..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/circle.yml +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | dependencies: | ||
2 | post: | ||
3 | # install golint | ||
4 | - go get github.com/golang/lint/golint | ||
5 | |||
6 | test: | ||
7 | pre: | ||
8 | # run analysis before tests | ||
9 | - go vet ./... | ||
10 | - test -z "$(golint ./... | tee /dev/stderr)" | ||
11 | - test -z "$(gofmt -s -l . | tee /dev/stderr)" | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/duration.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/duration.go deleted file mode 100644 index c219a8a..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/duration.go +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | // Package units provides helper function to parse and print size and time units | ||
2 | // in human-readable format. | ||
3 | package units | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "time" | ||
8 | ) | ||
9 | |||
10 | // HumanDuration returns a human-readable approximation of a duration | ||
11 | // (eg. "About a minute", "4 hours ago", etc.). | ||
12 | func HumanDuration(d time.Duration) string { | ||
13 | if seconds := int(d.Seconds()); seconds < 1 { | ||
14 | return "Less than a second" | ||
15 | } else if seconds < 60 { | ||
16 | return fmt.Sprintf("%d seconds", seconds) | ||
17 | } else if minutes := int(d.Minutes()); minutes == 1 { | ||
18 | return "About a minute" | ||
19 | } else if minutes < 60 { | ||
20 | return fmt.Sprintf("%d minutes", minutes) | ||
21 | } else if hours := int(d.Hours()); hours == 1 { | ||
22 | return "About an hour" | ||
23 | } else if hours < 48 { | ||
24 | return fmt.Sprintf("%d hours", hours) | ||
25 | } else if hours < 24*7*2 { | ||
26 | return fmt.Sprintf("%d days", hours/24) | ||
27 | } else if hours < 24*30*3 { | ||
28 | return fmt.Sprintf("%d weeks", hours/24/7) | ||
29 | } else if hours < 24*365*2 { | ||
30 | return fmt.Sprintf("%d months", hours/24/30) | ||
31 | } | ||
32 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) | ||
33 | } | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/size.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/size.go deleted file mode 100644 index 3b59daf..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/size.go +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | package units | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "regexp" | ||
6 | "strconv" | ||
7 | "strings" | ||
8 | ) | ||
9 | |||
10 | // See: http://en.wikipedia.org/wiki/Binary_prefix | ||
11 | const ( | ||
12 | // Decimal | ||
13 | |||
14 | KB = 1000 | ||
15 | MB = 1000 * KB | ||
16 | GB = 1000 * MB | ||
17 | TB = 1000 * GB | ||
18 | PB = 1000 * TB | ||
19 | |||
20 | // Binary | ||
21 | |||
22 | KiB = 1024 | ||
23 | MiB = 1024 * KiB | ||
24 | GiB = 1024 * MiB | ||
25 | TiB = 1024 * GiB | ||
26 | PiB = 1024 * TiB | ||
27 | ) | ||
28 | |||
29 | type unitMap map[string]int64 | ||
30 | |||
31 | var ( | ||
32 | decimalMap = unitMap{"k": KB, "m": MB, "g": GB, "t": TB, "p": PB} | ||
33 | binaryMap = unitMap{"k": KiB, "m": MiB, "g": GiB, "t": TiB, "p": PiB} | ||
34 | sizeRegex = regexp.MustCompile(`^(\d+)([kKmMgGtTpP])?[bB]?$`) | ||
35 | ) | ||
36 | |||
37 | var decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} | ||
38 | var binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"} | ||
39 | |||
40 | // CustomSize returns a human-readable approximation of a size | ||
41 | // using custom format. | ||
42 | func CustomSize(format string, size float64, base float64, _map []string) string { | ||
43 | i := 0 | ||
44 | for size >= base { | ||
45 | size = size / base | ||
46 | i++ | ||
47 | } | ||
48 | return fmt.Sprintf(format, size, _map[i]) | ||
49 | } | ||
50 | |||
51 | // HumanSize returns a human-readable approximation of a size | ||
52 | // capped at 4 valid numbers (eg. "2.746 MB", "796 KB"). | ||
53 | func HumanSize(size float64) string { | ||
54 | return CustomSize("%.4g %s", size, 1000.0, decimapAbbrs) | ||
55 | } | ||
56 | |||
57 | // BytesSize returns a human-readable size in bytes, kibibytes, | ||
58 | // mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB"). | ||
59 | func BytesSize(size float64) string { | ||
60 | return CustomSize("%.4g %s", size, 1024.0, binaryAbbrs) | ||
61 | } | ||
62 | |||
63 | // FromHumanSize returns an integer from a human-readable specification of a | ||
64 | // size using SI standard (eg. "44kB", "17MB"). | ||
65 | func FromHumanSize(size string) (int64, error) { | ||
66 | return parseSize(size, decimalMap) | ||
67 | } | ||
68 | |||
69 | // RAMInBytes parses a human-readable string representing an amount of RAM | ||
70 | // in bytes, kibibytes, mebibytes, gibibytes, or tebibytes and | ||
71 | // returns the number of bytes, or -1 if the string is unparseable. | ||
72 | // Units are case-insensitive, and the 'b' suffix is optional. | ||
73 | func RAMInBytes(size string) (int64, error) { | ||
74 | return parseSize(size, binaryMap) | ||
75 | } | ||
76 | |||
77 | // Parses the human-readable size string into the amount it represents. | ||
78 | func parseSize(sizeStr string, uMap unitMap) (int64, error) { | ||
79 | matches := sizeRegex.FindStringSubmatch(sizeStr) | ||
80 | if len(matches) != 3 { | ||
81 | return -1, fmt.Errorf("invalid size: '%s'", sizeStr) | ||
82 | } | ||
83 | |||
84 | size, err := strconv.ParseInt(matches[1], 10, 0) | ||
85 | if err != nil { | ||
86 | return -1, err | ||
87 | } | ||
88 | |||
89 | unitPrefix := strings.ToLower(matches[2]) | ||
90 | if mul, ok := uMap[unitPrefix]; ok { | ||
91 | size *= mul | ||
92 | } | ||
93 | |||
94 | return size, nil | ||
95 | } | ||
diff --git a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/ulimit.go b/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/ulimit.go deleted file mode 100644 index 5ac7fd8..0000000 --- a/vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/go-units/ulimit.go +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | package units | ||
2 | |||
3 | import ( | ||
4 | "fmt" | ||
5 | "strconv" | ||
6 | "strings" | ||
7 | ) | ||
8 | |||
9 | // Ulimit is a human friendly version of Rlimit. | ||
10 | type Ulimit struct { | ||
11 | Name string | ||
12 | Hard int64 | ||
13 | Soft int64 | ||
14 | } | ||
15 | |||
16 | // Rlimit specifies the resource limits, such as max open files. | ||
17 | type Rlimit struct { | ||
18 | Type int `json:"type,omitempty"` | ||
19 | Hard uint64 `json:"hard,omitempty"` | ||
20 | Soft uint64 `json:"soft,omitempty"` | ||
21 | } | ||
22 | |||
23 | const ( | ||
24 | // magic numbers for making the syscall | ||
25 | // some of these are defined in the syscall package, but not all. | ||
26 | // Also since Windows client doesn't get access to the syscall package, need to | ||
27 | // define these here | ||
28 | rlimitAs = 9 | ||
29 | rlimitCore = 4 | ||
30 | rlimitCPU = 0 | ||
31 | rlimitData = 2 | ||
32 | rlimitFsize = 1 | ||
33 | rlimitLocks = 10 | ||
34 | rlimitMemlock = 8 | ||
35 | rlimitMsgqueue = 12 | ||
36 | rlimitNice = 13 | ||
37 | rlimitNofile = 7 | ||
38 | rlimitNproc = 6 | ||
39 | rlimitRss = 5 | ||
40 | rlimitRtprio = 14 | ||
41 | rlimitRttime = 15 | ||
42 | rlimitSigpending = 11 | ||
43 | rlimitStack = 3 | ||
44 | ) | ||
45 | |||
46 | var ulimitNameMapping = map[string]int{ | ||
47 | //"as": rlimitAs, // Disabled since this doesn't seem usable with the way Docker inits a container. | ||
48 | "core": rlimitCore, | ||
49 | "cpu": rlimitCPU, | ||
50 | "data": rlimitData, | ||
51 | "fsize": rlimitFsize, | ||
52 | "locks": rlimitLocks, | ||
53 | "memlock": rlimitMemlock, | ||
54 | "msgqueue": rlimitMsgqueue, | ||
55 | "nice": rlimitNice, | ||
56 | "nofile": rlimitNofile, | ||
57 | "nproc": rlimitNproc, | ||
58 | "rss": rlimitRss, | ||
59 | "rtprio": rlimitRtprio, | ||
60 | "rttime": rlimitRttime, | ||
61 | "sigpending": rlimitSigpending, | ||
62 | "stack": rlimitStack, | ||
63 | } | ||
64 | |||
65 | // ParseUlimit parses and returns a Ulimit from the specified string. | ||
66 | func ParseUlimit(val string) (*Ulimit, error) { | ||
67 | parts := strings.SplitN(val, "=", 2) | ||
68 | if len(parts) != 2 { | ||
69 | return nil, fmt.Errorf("invalid ulimit argument: %s", val) | ||
70 | } | ||
71 | |||
72 | if _, exists := ulimitNameMapping[parts[0]]; !exists { | ||
73 | return nil, fmt.Errorf("invalid ulimit type: %s", parts[0]) | ||
74 | } | ||
75 | |||
76 | var ( | ||
77 | soft int64 | ||
78 | hard = &soft // default to soft in case no hard was set | ||
79 | temp int64 | ||
80 | err error | ||
81 | ) | ||
82 | switch limitVals := strings.Split(parts[1], ":"); len(limitVals) { | ||
83 | case 2: | ||
84 | temp, err = strconv.ParseInt(limitVals[1], 10, 64) | ||
85 | if err != nil { | ||
86 | return nil, err | ||
87 | } | ||
88 | hard = &temp | ||
89 | fallthrough | ||
90 | case 1: | ||
91 | soft, err = strconv.ParseInt(limitVals[0], 10, 64) | ||
92 | if err != nil { | ||
93 | return nil, err | ||
94 | } | ||
95 | default: | ||
96 | return nil, fmt.Errorf("too many limit value arguments - %s, can only have up to two, `soft[:hard]`", parts[1]) | ||
97 | } | ||
98 | |||
99 | if soft > *hard { | ||
100 | return nil, fmt.Errorf("ulimit soft limit must be less than or equal to hard limit: %d > %d", soft, *hard) | ||
101 | } | ||
102 | |||
103 | return &Ulimit{Name: parts[0], Soft: soft, Hard: *hard}, nil | ||
104 | } | ||
105 | |||
106 | // GetRlimit returns the RLimit corresponding to Ulimit. | ||
107 | func (u *Ulimit) GetRlimit() (*Rlimit, error) { | ||
108 | t, exists := ulimitNameMapping[u.Name] | ||
109 | if !exists { | ||
110 | return nil, fmt.Errorf("invalid ulimit name %s", u.Name) | ||
111 | } | ||
112 | |||
113 | return &Rlimit{Type: t, Soft: uint64(u.Soft), Hard: uint64(u.Hard)}, nil | ||
114 | } | ||
115 | |||
116 | func (u *Ulimit) String() string { | ||
117 | return fmt.Sprintf("%s=%d:%d", u.Name, u.Soft, u.Hard) | ||
118 | } | ||