Upgrade K8s and Go versionstags/v0.7.0
| @@ -9,7 +9,7 @@ on: | |||
| jobs: | |||
| verify-and-lint: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: Verify codegen/vendor/licenses, do lint | |||
| env: | |||
| GOPATH: ${{ github.workspace }} | |||
| @@ -21,7 +21,7 @@ jobs: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - name: Checkout code | |||
| uses: actions/checkout@v2 | |||
| @@ -51,13 +51,13 @@ jobs: | |||
| working-directory: ${{ env.CODE_DIR }} | |||
| build: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: build gm and lc | |||
| steps: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - uses: actions/cache@v2 | |||
| with: | |||
| @@ -72,13 +72,13 @@ jobs: | |||
| - run: make build # without verify | |||
| basic_test: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: 'Unit test, integration test edge (noop now)' | |||
| steps: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - uses: actions/cache@v2 | |||
| with: | |||
| @@ -96,13 +96,13 @@ jobs: | |||
| - run: ': to be added' | |||
| e2e_test: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: 'E2e test' | |||
| steps: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - uses: actions/cache@v2 | |||
| with: | |||
| @@ -114,7 +114,7 @@ jobs: | |||
| # since this ubuntu-latest os has already kind/kubectl/jq(see https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md), | |||
| # but kind v0.19.0 has different api with v0.18.0, so here to reinstall kind v0.18.0 | |||
| sudo apt-get install -y jq | |||
| go get sigs.k8s.io/kind@$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/97518847 | jq -r .tag_name) | |||
| go install sigs.k8s.io/kind@$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/97518847 | jq -r .tag_name) | |||
| kind version | |||
| type kubectl || { | |||
| curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | |||
| @@ -131,13 +131,13 @@ jobs: | |||
| - run: make e2e | |||
| docker_build: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: docker image build for gm/lc | |||
| steps: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - uses: actions/cache@v2 | |||
| with: | |||
| @@ -152,13 +152,13 @@ jobs: | |||
| - run: make images | |||
| docker_cross_build: | |||
| runs-on: ubuntu-latest | |||
| runs-on: ubuntu-22.04 | |||
| name: docker cross build images for gm/lc/kb | |||
| steps: | |||
| - name: Install Go | |||
| uses: actions/setup-go@v2 | |||
| with: | |||
| go-version: 1.16.x | |||
| go-version: 1.22.9 | |||
| - uses: actions/cache@v2 | |||
| with: | |||
| @@ -12,21 +12,49 @@ run: | |||
| # exit code when at least one issue was found, default is 1 | |||
| issues-exit-code: 1 | |||
| # which dirs to skip: issues from them won't be reported; | |||
| # can use regexp here: generated.*, regexp is applied on full path; | |||
| # default value is empty list, but default dirs are skipped independently | |||
| # from this option's value (see skip-dirs-use-default). | |||
| # "/" will be replaced by current OS file path separator to properly work | |||
| # on Windows. | |||
| skip-dirs: | |||
| issues: | |||
| # Which dirs to exclude: issues from them won't be reported. | |||
| # Can use regexp here: `generated.*`, regexp is applied on full path, | |||
| # including the path prefix if one is set. | |||
| # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). | |||
| # "/" will be replaced by current OS file path separator to properly work on Windows. | |||
| # Default: [] | |||
| exclude-dirs: | |||
| - vendor | |||
| - fake | |||
| - externalversions | |||
| exclude-dirs-use-default: true | |||
| # output configuration options | |||
| output: | |||
| # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | |||
| format: colored-line-number | |||
| # The formats used to render issues. | |||
| # Formats: | |||
| # - `colored-line-number` | |||
| # - `line-number` | |||
| # - `json` | |||
| # - `colored-tab` | |||
| # - `tab` | |||
| # - `html` | |||
| # - `checkstyle` | |||
| # - `code-climate` | |||
| # - `junit-xml` | |||
| # - `junit-xml-extended` | |||
| # - `github-actions` | |||
| # - `teamcity` | |||
| # - `sarif` | |||
| # Output path can be either `stdout`, `stderr` or path to the file to write to. | |||
| # | |||
| # For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. | |||
| # The output can be specified for each of them by separating format name and path by colon symbol. | |||
| # Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" | |||
| # The CLI flag (`--out-format`) override the configuration file. | |||
| # | |||
| # Default: | |||
| # formats: | |||
| # - format: colored-line-number | |||
| # path: stdout | |||
| formats: | |||
| - format: colored-line-number | |||
| # print lines of code with issue, default is true | |||
| print-issued-lines: true | |||
| @@ -41,13 +69,21 @@ linters-settings: | |||
| misspell: | |||
| ignore-words: | |||
| - mosquitto | |||
| revive: | |||
| rules: | |||
| - name: unused-parameter | |||
| severity: warning | |||
| disabled: true | |||
| - name: unused-receiver | |||
| severity: warning | |||
| disabled: true | |||
| linters: | |||
| disable-all: true | |||
| enable: | |||
| - goconst | |||
| - gofmt | |||
| - golint | |||
| - revive | |||
| - gosimple | |||
| - govet | |||
| - misspell | |||
| @@ -1,16 +0,0 @@ | |||
| = vendor/github.com/PuerkitoBio/purell licensed under: = | |||
| Copyright (c) 2012, Martin Angers | |||
| All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |||
| * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |||
| * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| = vendor/github.com/PuerkitoBio/purell/LICENSE fb8b39492731abb9a3d68575f3eedbfa | |||
| @@ -1,31 +0,0 @@ | |||
| = vendor/github.com/PuerkitoBio/urlesc licensed under: = | |||
| Copyright (c) 2012 The Go Authors. All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| * Redistributions of source code must retain the above copyright | |||
| notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above | |||
| copyright notice, this list of conditions and the following disclaimer | |||
| in the documentation and/or other materials provided with the | |||
| distribution. | |||
| * Neither the name of Google Inc. nor the names of its | |||
| contributors may be used to endorse or promote products derived from | |||
| this software without specific prior written permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| = vendor/github.com/PuerkitoBio/urlesc/LICENSE 591778525c869cdde0ab5a1bf283cd81 | |||
| @@ -0,0 +1,24 @@ | |||
| = vendor/github.com/beorn7/perks licensed under: = | |||
| Copyright (C) 2013 Blake Mizerany | |||
| Permission is hereby granted, free of charge, to any person obtaining | |||
| a copy of this software and associated documentation files (the | |||
| "Software"), to deal in the Software without restriction, including | |||
| without limitation the rights to use, copy, modify, merge, publish, | |||
| distribute, sublicense, and/or sell copies of the Software, and to | |||
| permit persons to whom the Software is furnished to do so, subject to | |||
| the following conditions: | |||
| The above copyright notice and this permission notice shall be | |||
| included in all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| = vendor/github.com/beorn7/perks/LICENSE 0d0738f37ee8dc0b5f88a32e83c60198 | |||
| @@ -0,0 +1,26 @@ | |||
| = vendor/github.com/blang/semver/v4 licensed under: = | |||
| The MIT License | |||
| Copyright (c) 2014 Benedikt Lang <github at benediktlang.de> | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in | |||
| all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| = vendor/github.com/blang/semver/v4/LICENSE 5a3ade42a900439691ebc22013660cae | |||
| @@ -0,0 +1,26 @@ | |||
| = vendor/github.com/cespare/xxhash/v2 licensed under: = | |||
| Copyright (c) 2016 Caleb Spare | |||
| MIT License | |||
| Permission is hereby granted, free of charge, to any person obtaining | |||
| a copy of this software and associated documentation files (the | |||
| "Software"), to deal in the Software without restriction, including | |||
| without limitation the rights to use, copy, modify, merge, publish, | |||
| distribute, sublicense, and/or sell copies of the Software, and to | |||
| permit persons to whom the Software is furnished to do so, subject to | |||
| the following conditions: | |||
| The above copyright notice and this permission notice shall be | |||
| included in all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| = vendor/github.com/cespare/xxhash/v2/LICENSE.txt 802da049c92a99b4387d3f3d91b00fa9 | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/github.com/docker/distribution licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "{}" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright {yyyy} {name of copyright owner} | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/docker/distribution/LICENSE d2794c0df5b907fdace235a619d80314 | |||
| @@ -22,4 +22,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| = vendor/github.com/emicklei/go-restful/LICENSE 2ebc1c12a0f4eae5394522e31961e1de | |||
| = vendor/github.com/emicklei/go-restful/v3/LICENSE 2ebc1c12a0f4eae5394522e31961e1de | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/github.com/go-openapi/spec licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/go-openapi/spec/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 | |||
| @@ -0,0 +1,207 @@ | |||
| = vendor/github.com/google/gnostic-models licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/google/gnostic-models/LICENSE b1e01b26bacfc2232046c90a330332b3 | |||
| @@ -1,207 +0,0 @@ | |||
| = vendor/github.com/googleapis/gnostic licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/googleapis/gnostic/LICENSE b1e01b26bacfc2232046c90a330332b3 | |||
| @@ -1,366 +0,0 @@ | |||
| = vendor/github.com/hashicorp/golang-lru licensed under: = | |||
| Mozilla Public License, version 2.0 | |||
| 1. Definitions | |||
| 1.1. "Contributor" | |||
| means each individual or legal entity that creates, contributes to the | |||
| creation of, or owns Covered Software. | |||
| 1.2. "Contributor Version" | |||
| means the combination of the Contributions of others (if any) used by a | |||
| Contributor and that particular Contributor's Contribution. | |||
| 1.3. "Contribution" | |||
| means Covered Software of a particular Contributor. | |||
| 1.4. "Covered Software" | |||
| means Source Code Form to which the initial Contributor has attached the | |||
| notice in Exhibit A, the Executable Form of such Source Code Form, and | |||
| Modifications of such Source Code Form, in each case including portions | |||
| thereof. | |||
| 1.5. "Incompatible With Secondary Licenses" | |||
| means | |||
| a. that the initial Contributor has attached the notice described in | |||
| Exhibit B to the Covered Software; or | |||
| b. that the Covered Software was made available under the terms of | |||
| version 1.1 or earlier of the License, but not also under the terms of | |||
| a Secondary License. | |||
| 1.6. "Executable Form" | |||
| means any form of the work other than Source Code Form. | |||
| 1.7. "Larger Work" | |||
| means a work that combines Covered Software with other material, in a | |||
| separate file or files, that is not Covered Software. | |||
| 1.8. "License" | |||
| means this document. | |||
| 1.9. "Licensable" | |||
| means having the right to grant, to the maximum extent possible, whether | |||
| at the time of the initial grant or subsequently, any and all of the | |||
| rights conveyed by this License. | |||
| 1.10. "Modifications" | |||
| means any of the following: | |||
| a. any file in Source Code Form that results from an addition to, | |||
| deletion from, or modification of the contents of Covered Software; or | |||
| b. any new file in Source Code Form that contains any Covered Software. | |||
| 1.11. "Patent Claims" of a Contributor | |||
| means any patent claim(s), including without limitation, method, | |||
| process, and apparatus claims, in any patent Licensable by such | |||
| Contributor that would be infringed, but for the grant of the License, | |||
| by the making, using, selling, offering for sale, having made, import, | |||
| or transfer of either its Contributions or its Contributor Version. | |||
| 1.12. "Secondary License" | |||
| means either the GNU General Public License, Version 2.0, the GNU Lesser | |||
| General Public License, Version 2.1, the GNU Affero General Public | |||
| License, Version 3.0, or any later versions of those licenses. | |||
| 1.13. "Source Code Form" | |||
| means the form of the work preferred for making modifications. | |||
| 1.14. "You" (or "Your") | |||
| means an individual or a legal entity exercising rights under this | |||
| License. For legal entities, "You" includes any entity that controls, is | |||
| controlled by, or is under common control with You. For purposes of this | |||
| definition, "control" means (a) the power, direct or indirect, to cause | |||
| the direction or management of such entity, whether by contract or | |||
| otherwise, or (b) ownership of more than fifty percent (50%) of the | |||
| outstanding shares or beneficial ownership of such entity. | |||
| 2. License Grants and Conditions | |||
| 2.1. Grants | |||
| Each Contributor hereby grants You a world-wide, royalty-free, | |||
| non-exclusive license: | |||
| a. under intellectual property rights (other than patent or trademark) | |||
| Licensable by such Contributor to use, reproduce, make available, | |||
| modify, display, perform, distribute, and otherwise exploit its | |||
| Contributions, either on an unmodified basis, with Modifications, or | |||
| as part of a Larger Work; and | |||
| b. under Patent Claims of such Contributor to make, use, sell, offer for | |||
| sale, have made, import, and otherwise transfer either its | |||
| Contributions or its Contributor Version. | |||
| 2.2. Effective Date | |||
| The licenses granted in Section 2.1 with respect to any Contribution | |||
| become effective for each Contribution on the date the Contributor first | |||
| distributes such Contribution. | |||
| 2.3. Limitations on Grant Scope | |||
| The licenses granted in this Section 2 are the only rights granted under | |||
| this License. No additional rights or licenses will be implied from the | |||
| distribution or licensing of Covered Software under this License. | |||
| Notwithstanding Section 2.1(b) above, no patent license is granted by a | |||
| Contributor: | |||
| a. for any code that a Contributor has removed from Covered Software; or | |||
| b. for infringements caused by: (i) Your and any other third party's | |||
| modifications of Covered Software, or (ii) the combination of its | |||
| Contributions with other software (except as part of its Contributor | |||
| Version); or | |||
| c. under Patent Claims infringed by Covered Software in the absence of | |||
| its Contributions. | |||
| This License does not grant any rights in the trademarks, service marks, | |||
| or logos of any Contributor (except as may be necessary to comply with | |||
| the notice requirements in Section 3.4). | |||
| 2.4. Subsequent Licenses | |||
| No Contributor makes additional grants as a result of Your choice to | |||
| distribute the Covered Software under a subsequent version of this | |||
| License (see Section 10.2) or under the terms of a Secondary License (if | |||
| permitted under the terms of Section 3.3). | |||
| 2.5. Representation | |||
| Each Contributor represents that the Contributor believes its | |||
| Contributions are its original creation(s) or it has sufficient rights to | |||
| grant the rights to its Contributions conveyed by this License. | |||
| 2.6. Fair Use | |||
| This License is not intended to limit any rights You have under | |||
| applicable copyright doctrines of fair use, fair dealing, or other | |||
| equivalents. | |||
| 2.7. Conditions | |||
| Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in | |||
| Section 2.1. | |||
| 3. Responsibilities | |||
| 3.1. Distribution of Source Form | |||
| All distribution of Covered Software in Source Code Form, including any | |||
| Modifications that You create or to which You contribute, must be under | |||
| the terms of this License. You must inform recipients that the Source | |||
| Code Form of the Covered Software is governed by the terms of this | |||
| License, and how they can obtain a copy of this License. You may not | |||
| attempt to alter or restrict the recipients' rights in the Source Code | |||
| Form. | |||
| 3.2. Distribution of Executable Form | |||
| If You distribute Covered Software in Executable Form then: | |||
| a. such Covered Software must also be made available in Source Code Form, | |||
| as described in Section 3.1, and You must inform recipients of the | |||
| Executable Form how they can obtain a copy of such Source Code Form by | |||
| reasonable means in a timely manner, at a charge no more than the cost | |||
| of distribution to the recipient; and | |||
| b. You may distribute such Executable Form under the terms of this | |||
| License, or sublicense it under different terms, provided that the | |||
| license for the Executable Form does not attempt to limit or alter the | |||
| recipients' rights in the Source Code Form under this License. | |||
| 3.3. Distribution of a Larger Work | |||
| You may create and distribute a Larger Work under terms of Your choice, | |||
| provided that You also comply with the requirements of this License for | |||
| the Covered Software. If the Larger Work is a combination of Covered | |||
| Software with a work governed by one or more Secondary Licenses, and the | |||
| Covered Software is not Incompatible With Secondary Licenses, this | |||
| License permits You to additionally distribute such Covered Software | |||
| under the terms of such Secondary License(s), so that the recipient of | |||
| the Larger Work may, at their option, further distribute the Covered | |||
| Software under the terms of either this License or such Secondary | |||
| License(s). | |||
| 3.4. Notices | |||
| You may not remove or alter the substance of any license notices | |||
| (including copyright notices, patent notices, disclaimers of warranty, or | |||
| limitations of liability) contained within the Source Code Form of the | |||
| Covered Software, except that You may alter any license notices to the | |||
| extent required to remedy known factual inaccuracies. | |||
| 3.5. Application of Additional Terms | |||
| You may choose to offer, and to charge a fee for, warranty, support, | |||
| indemnity or liability obligations to one or more recipients of Covered | |||
| Software. However, You may do so only on Your own behalf, and not on | |||
| behalf of any Contributor. You must make it absolutely clear that any | |||
| such warranty, support, indemnity, or liability obligation is offered by | |||
| You alone, and You hereby agree to indemnify every Contributor for any | |||
| liability incurred by such Contributor as a result of warranty, support, | |||
| indemnity or liability terms You offer. You may include additional | |||
| disclaimers of warranty and limitations of liability specific to any | |||
| jurisdiction. | |||
| 4. Inability to Comply Due to Statute or Regulation | |||
| If it is impossible for You to comply with any of the terms of this License | |||
| with respect to some or all of the Covered Software due to statute, | |||
| judicial order, or regulation then You must: (a) comply with the terms of | |||
| this License to the maximum extent possible; and (b) describe the | |||
| limitations and the code they affect. Such description must be placed in a | |||
| text file included with all distributions of the Covered Software under | |||
| this License. Except to the extent prohibited by statute or regulation, | |||
| such description must be sufficiently detailed for a recipient of ordinary | |||
| skill to be able to understand it. | |||
| 5. Termination | |||
| 5.1. The rights granted under this License will terminate automatically if You | |||
| fail to comply with any of its terms. However, if You become compliant, | |||
| then the rights granted under this License from a particular Contributor | |||
| are reinstated (a) provisionally, unless and until such Contributor | |||
| explicitly and finally terminates Your grants, and (b) on an ongoing | |||
| basis, if such Contributor fails to notify You of the non-compliance by | |||
| some reasonable means prior to 60 days after You have come back into | |||
| compliance. Moreover, Your grants from a particular Contributor are | |||
| reinstated on an ongoing basis if such Contributor notifies You of the | |||
| non-compliance by some reasonable means, this is the first time You have | |||
| received notice of non-compliance with this License from such | |||
| Contributor, and You become compliant prior to 30 days after Your receipt | |||
| of the notice. | |||
| 5.2. If You initiate litigation against any entity by asserting a patent | |||
| infringement claim (excluding declaratory judgment actions, | |||
| counter-claims, and cross-claims) alleging that a Contributor Version | |||
| directly or indirectly infringes any patent, then the rights granted to | |||
| You by any and all Contributors for the Covered Software under Section | |||
| 2.1 of this License shall terminate. | |||
| 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user | |||
| license agreements (excluding distributors and resellers) which have been | |||
| validly granted by You or Your distributors under this License prior to | |||
| termination shall survive termination. | |||
| 6. Disclaimer of Warranty | |||
| Covered Software is provided under this License on an "as is" basis, | |||
| without warranty of any kind, either expressed, implied, or statutory, | |||
| including, without limitation, warranties that the Covered Software is free | |||
| of defects, merchantable, fit for a particular purpose or non-infringing. | |||
| The entire risk as to the quality and performance of the Covered Software | |||
| is with You. Should any Covered Software prove defective in any respect, | |||
| You (not any Contributor) assume the cost of any necessary servicing, | |||
| repair, or correction. This disclaimer of warranty constitutes an essential | |||
| part of this License. No use of any Covered Software is authorized under | |||
| this License except under this disclaimer. | |||
| 7. Limitation of Liability | |||
| Under no circumstances and under no legal theory, whether tort (including | |||
| negligence), contract, or otherwise, shall any Contributor, or anyone who | |||
| distributes Covered Software as permitted above, be liable to You for any | |||
| direct, indirect, special, incidental, or consequential damages of any | |||
| character including, without limitation, damages for lost profits, loss of | |||
| goodwill, work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses, even if such party shall have been | |||
| informed of the possibility of such damages. This limitation of liability | |||
| shall not apply to liability for death or personal injury resulting from | |||
| such party's negligence to the extent applicable law prohibits such | |||
| limitation. Some jurisdictions do not allow the exclusion or limitation of | |||
| incidental or consequential damages, so this exclusion and limitation may | |||
| not apply to You. | |||
| 8. Litigation | |||
| Any litigation relating to this License may be brought only in the courts | |||
| of a jurisdiction where the defendant maintains its principal place of | |||
| business and such litigation shall be governed by laws of that | |||
| jurisdiction, without reference to its conflict-of-law provisions. Nothing | |||
| in this Section shall prevent a party's ability to bring cross-claims or | |||
| counter-claims. | |||
| 9. Miscellaneous | |||
| This License represents the complete agreement concerning the subject | |||
| matter hereof. If any provision of this License is held to be | |||
| unenforceable, such provision shall be reformed only to the extent | |||
| necessary to make it enforceable. Any law or regulation which provides that | |||
| the language of a contract shall be construed against the drafter shall not | |||
| be used to construe this License against a Contributor. | |||
| 10. Versions of the License | |||
| 10.1. New Versions | |||
| Mozilla Foundation is the license steward. Except as provided in Section | |||
| 10.3, no one other than the license steward has the right to modify or | |||
| publish new versions of this License. Each version will be given a | |||
| distinguishing version number. | |||
| 10.2. Effect of New Versions | |||
| You may distribute the Covered Software under the terms of the version | |||
| of the License under which You originally received the Covered Software, | |||
| or under the terms of any subsequent version published by the license | |||
| steward. | |||
| 10.3. Modified Versions | |||
| If you create software not governed by this License, and you want to | |||
| create a new license for such software, you may create and use a | |||
| modified version of this License if you rename the license and remove | |||
| any references to the name of the license steward (except to note that | |||
| such modified license differs from this License). | |||
| 10.4. Distributing Source Code Form that is Incompatible With Secondary | |||
| Licenses If You choose to distribute Source Code Form that is | |||
| Incompatible With Secondary Licenses under the terms of this version of | |||
| the License, the notice described in Exhibit B of this License must be | |||
| attached. | |||
| Exhibit A - Source Code Form License Notice | |||
| This Source Code Form is subject to the | |||
| terms of the Mozilla Public License, v. | |||
| 2.0. If a copy of the MPL was not | |||
| distributed with this file, You can | |||
| obtain one at | |||
| http://mozilla.org/MPL/2.0/. | |||
| If it is not possible or desirable to put the notice in a particular file, | |||
| then You may include the notice in a location (such as a LICENSE file in a | |||
| relevant directory) where a recipient would be likely to look for such a | |||
| notice. | |||
| You may add additional accurate notices of copyright ownership. | |||
| Exhibit B - "Incompatible With Secondary Licenses" Notice | |||
| This Source Code Form is "Incompatible | |||
| With Secondary Licenses", as defined by | |||
| the Mozilla Public License, v. 2.0. | |||
| = vendor/github.com/hashicorp/golang-lru/LICENSE f27a50d2e878867827842f2c60e30bfc | |||
| @@ -1,17 +1,205 @@ | |||
| = vendor/github.com/inconshreveable/mousetrap licensed under: = | |||
| Copyright 2014 Alan Shreve | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| 1. Definitions. | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| = vendor/github.com/inconshreveable/mousetrap/LICENSE b23cff9db13f093a4e6ff77105cbd8eb | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright 2022 Alan Shreve (@inconshreveable) | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/inconshreveable/mousetrap/LICENSE 7ea8c6c3cf90c1ca8494325e32c35579 | |||
| @@ -0,0 +1,25 @@ | |||
| = vendor/github.com/josharian/intern licensed under: = | |||
| MIT License | |||
| Copyright (c) 2019 Josh Bleecher Snyder | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in all | |||
| copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
| SOFTWARE. | |||
| = vendor/github.com/josharian/intern/license.md 6bc75378a26e0addbcdfa118e4d54574 | |||
| @@ -0,0 +1,205 @@ | |||
| = vendor/github.com/matttproud/golang_protobuf_extensions licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "{}" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright {yyyy} {name of copyright owner} | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/matttproud/golang_protobuf_extensions/LICENSE e3fc50a88d0a364313df4b21ef20c29e | |||
| @@ -0,0 +1,35 @@ | |||
| = vendor/github.com/munnerz/goautoneg licensed under: = | |||
| Copyright (c) 2011, Open Knowledge Foundation Ltd. | |||
| All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| Redistributions of source code must retain the above copyright | |||
| notice, this list of conditions and the following disclaimer. | |||
| Redistributions in binary form must reproduce the above copyright | |||
| notice, this list of conditions and the following disclaimer in | |||
| the documentation and/or other materials provided with the | |||
| distribution. | |||
| Neither the name of the Open Knowledge Foundation Ltd. nor the | |||
| names of its contributors may be used to endorse or promote | |||
| products derived from this software without specific prior written | |||
| permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
| HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| = vendor/github.com/munnerz/goautoneg/LICENSE 0c241922fc69330e2e5590de114f3bf5 | |||
| @@ -1,196 +0,0 @@ | |||
| = vendor/github.com/opencontainers/go-digest licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| https://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| Copyright 2019, 2020 OCI Contributors | |||
| Copyright 2016 Docker, Inc. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| https://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/opencontainers/go-digest/LICENSE 2d6fc0e85c3f118af64c85a78d56d3cf | |||
| @@ -0,0 +1,205 @@ | |||
| = vendor/github.com/prometheus/client_golang licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/prometheus/client_golang/LICENSE 86d3f3a95c324c9479bd8986968f4327 | |||
| @@ -0,0 +1,205 @@ | |||
| = vendor/github.com/prometheus/client_model licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/prometheus/client_model/LICENSE 86d3f3a95c324c9479bd8986968f4327 | |||
| @@ -0,0 +1,205 @@ | |||
| = vendor/github.com/prometheus/common licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/prometheus/common/LICENSE 86d3f3a95c324c9479bd8986968f4327 | |||
| @@ -0,0 +1,205 @@ | |||
| = vendor/github.com/prometheus/procfs licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/github.com/prometheus/procfs/LICENSE 86d3f3a95c324c9479bd8986968f4327 | |||
| @@ -1,23 +0,0 @@ | |||
| = vendor/go.uber.org/atomic licensed under: = | |||
| Copyright (c) 2016 Uber Technologies, Inc. | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in | |||
| all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| = vendor/go.uber.org/atomic/LICENSE.txt 1caee86519456feda989f8a838102b50 | |||
| @@ -1,23 +0,0 @@ | |||
| = vendor/go.uber.org/multierr licensed under: = | |||
| Copyright (c) 2017 Uber Technologies, Inc. | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in | |||
| all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| = vendor/go.uber.org/multierr/LICENSE.txt f65b21a547112d1bc7b11b90f9b31997 | |||
| @@ -1,23 +0,0 @@ | |||
| = vendor/go.uber.org/zap licensed under: = | |||
| Copyright (c) 2016-2017 Uber Technologies, Inc. | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in | |||
| all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| = vendor/go.uber.org/zap/LICENSE.txt 5e8153e456a82529ea845e0d511abb69 | |||
| @@ -1,31 +0,0 @@ | |||
| = vendor/golang.org/x/xerrors licensed under: = | |||
| Copyright (c) 2019 The Go Authors. All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| * Redistributions of source code must retain the above copyright | |||
| notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above | |||
| copyright notice, this list of conditions and the following disclaimer | |||
| in the documentation and/or other materials provided with the | |||
| distribution. | |||
| * Neither the name of Google Inc. nor the names of its | |||
| contributors may be used to endorse or promote products derived from | |||
| this software without specific prior written permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| = vendor/golang.org/x/xerrors/LICENSE a413d6b3884e141783f23d00d5838777 | |||
| @@ -0,0 +1,54 @@ | |||
| = vendor/gopkg.in/yaml.v3 licensed under: = | |||
| This project is covered by two different licenses: MIT and Apache. | |||
| #### MIT License #### | |||
| The following files were ported to Go from C files of libyaml, and thus | |||
| are still covered by their original MIT license, with the additional | |||
| copyright staring in 2011 when the project was ported over: | |||
| apic.go emitterc.go parserc.go readerc.go scannerc.go | |||
| writerc.go yamlh.go yamlprivateh.go | |||
| Copyright (c) 2006-2010 Kirill Simonov | |||
| Copyright (c) 2006-2011 Kirill Simonov | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |||
| this software and associated documentation files (the "Software"), to deal in | |||
| the Software without restriction, including without limitation the rights to | |||
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |||
| of the Software, and to permit persons to whom the Software is furnished to do | |||
| so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in all | |||
| copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
| SOFTWARE. | |||
| ### Apache License ### | |||
| All the remaining project files are covered by the Apache license: | |||
| Copyright (c) 2011-2019 Canonical Ltd | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/gopkg.in/yaml.v3/LICENSE 3c91c17266710e16afdbb2b6d15c761c | |||
| @@ -22,4 +22,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| = vendor/gorm.io/gorm/License 162a54d183196f03ce8b2a312e5919f8 | |||
| = vendor/gorm.io/gorm/LICENSE 162a54d183196f03ce8b2a312e5919f8 | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/k8s.io/apiserver licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/k8s.io/apiserver/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/k8s.io/component-helpers licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/k8s.io/component-helpers/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/k8s.io/gengo licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright 2014 The Kubernetes Authors. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/k8s.io/gengo/LICENSE ad09685d909e7a9f763d2bb62d4bd6fb | |||
| @@ -0,0 +1,206 @@ | |||
| = vendor/k8s.io/gengo/v2 licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright 2014 The Kubernetes Authors. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/k8s.io/gengo/v2/LICENSE ad09685d909e7a9f763d2bb62d4bd6fb | |||
| @@ -1,206 +0,0 @@ | |||
| = vendor/k8s.io/kubernetes licensed under: = | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "[]" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright [yyyy] [name of copyright owner] | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| = vendor/k8s.io/kubernetes/LICENSE 3b83ef96387f14655fc854ddc3c6bd57 | |||
| @@ -0,0 +1,242 @@ | |||
| = vendor/sigs.k8s.io/json licensed under: = | |||
| Files other than internal/golang/* licensed under: | |||
| Apache License | |||
| Version 2.0, January 2004 | |||
| http://www.apache.org/licenses/ | |||
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |||
| 1. Definitions. | |||
| "License" shall mean the terms and conditions for use, reproduction, | |||
| and distribution as defined by Sections 1 through 9 of this document. | |||
| "Licensor" shall mean the copyright owner or entity authorized by | |||
| the copyright owner that is granting the License. | |||
| "Legal Entity" shall mean the union of the acting entity and all | |||
| other entities that control, are controlled by, or are under common | |||
| control with that entity. For the purposes of this definition, | |||
| "control" means (i) the power, direct or indirect, to cause the | |||
| direction or management of such entity, whether by contract or | |||
| otherwise, or (ii) ownership of fifty percent (50%) or more of the | |||
| outstanding shares, or (iii) beneficial ownership of such entity. | |||
| "You" (or "Your") shall mean an individual or Legal Entity | |||
| exercising permissions granted by this License. | |||
| "Source" form shall mean the preferred form for making modifications, | |||
| including but not limited to software source code, documentation | |||
| source, and configuration files. | |||
| "Object" form shall mean any form resulting from mechanical | |||
| transformation or translation of a Source form, including but | |||
| not limited to compiled object code, generated documentation, | |||
| and conversions to other media types. | |||
| "Work" shall mean the work of authorship, whether in Source or | |||
| Object form, made available under the License, as indicated by a | |||
| copyright notice that is included in or attached to the work | |||
| (an example is provided in the Appendix below). | |||
| "Derivative Works" shall mean any work, whether in Source or Object | |||
| form, that is based on (or derived from) the Work and for which the | |||
| editorial revisions, annotations, elaborations, or other modifications | |||
| represent, as a whole, an original work of authorship. For the purposes | |||
| of this License, Derivative Works shall not include works that remain | |||
| separable from, or merely link (or bind by name) to the interfaces of, | |||
| the Work and Derivative Works thereof. | |||
| "Contribution" shall mean any work of authorship, including | |||
| the original version of the Work and any modifications or additions | |||
| to that Work or Derivative Works thereof, that is intentionally | |||
| submitted to Licensor for inclusion in the Work by the copyright owner | |||
| or by an individual or Legal Entity authorized to submit on behalf of | |||
| the copyright owner. For the purposes of this definition, "submitted" | |||
| means any form of electronic, verbal, or written communication sent | |||
| to the Licensor or its representatives, including but not limited to | |||
| communication on electronic mailing lists, source code control systems, | |||
| and issue tracking systems that are managed by, or on behalf of, the | |||
| Licensor for the purpose of discussing and improving the Work, but | |||
| excluding communication that is conspicuously marked or otherwise | |||
| designated in writing by the copyright owner as "Not a Contribution." | |||
| "Contributor" shall mean Licensor and any individual or Legal Entity | |||
| on behalf of whom a Contribution has been received by Licensor and | |||
| subsequently incorporated within the Work. | |||
| 2. Grant of Copyright License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| copyright license to reproduce, prepare Derivative Works of, | |||
| publicly display, publicly perform, sublicense, and distribute the | |||
| Work and such Derivative Works in Source or Object form. | |||
| 3. Grant of Patent License. Subject to the terms and conditions of | |||
| this License, each Contributor hereby grants to You a perpetual, | |||
| worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |||
| (except as stated in this section) patent license to make, have made, | |||
| use, offer to sell, sell, import, and otherwise transfer the Work, | |||
| where such license applies only to those patent claims licensable | |||
| by such Contributor that are necessarily infringed by their | |||
| Contribution(s) alone or by combination of their Contribution(s) | |||
| with the Work to which such Contribution(s) was submitted. If You | |||
| institute patent litigation against any entity (including a | |||
| cross-claim or counterclaim in a lawsuit) alleging that the Work | |||
| or a Contribution incorporated within the Work constitutes direct | |||
| or contributory patent infringement, then any patent licenses | |||
| granted to You under this License for that Work shall terminate | |||
| as of the date such litigation is filed. | |||
| 4. Redistribution. You may reproduce and distribute copies of the | |||
| Work or Derivative Works thereof in any medium, with or without | |||
| modifications, and in Source or Object form, provided that You | |||
| meet the following conditions: | |||
| (a) You must give any other recipients of the Work or | |||
| Derivative Works a copy of this License; and | |||
| (b) You must cause any modified files to carry prominent notices | |||
| stating that You changed the files; and | |||
| (c) You must retain, in the Source form of any Derivative Works | |||
| that You distribute, all copyright, patent, trademark, and | |||
| attribution notices from the Source form of the Work, | |||
| excluding those notices that do not pertain to any part of | |||
| the Derivative Works; and | |||
| (d) If the Work includes a "NOTICE" text file as part of its | |||
| distribution, then any Derivative Works that You distribute must | |||
| include a readable copy of the attribution notices contained | |||
| within such NOTICE file, excluding those notices that do not | |||
| pertain to any part of the Derivative Works, in at least one | |||
| of the following places: within a NOTICE text file distributed | |||
| as part of the Derivative Works; within the Source form or | |||
| documentation, if provided along with the Derivative Works; or, | |||
| within a display generated by the Derivative Works, if and | |||
| wherever such third-party notices normally appear. The contents | |||
| of the NOTICE file are for informational purposes only and | |||
| do not modify the License. You may add Your own attribution | |||
| notices within Derivative Works that You distribute, alongside | |||
| or as an addendum to the NOTICE text from the Work, provided | |||
| that such additional attribution notices cannot be construed | |||
| as modifying the License. | |||
| You may add Your own copyright statement to Your modifications and | |||
| may provide additional or different license terms and conditions | |||
| for use, reproduction, or distribution of Your modifications, or | |||
| for any such Derivative Works as a whole, provided Your use, | |||
| reproduction, and distribution of the Work otherwise complies with | |||
| the conditions stated in this License. | |||
| 5. Submission of Contributions. Unless You explicitly state otherwise, | |||
| any Contribution intentionally submitted for inclusion in the Work | |||
| by You to the Licensor shall be under the terms and conditions of | |||
| this License, without any additional terms or conditions. | |||
| Notwithstanding the above, nothing herein shall supersede or modify | |||
| the terms of any separate license agreement you may have executed | |||
| with Licensor regarding such Contributions. | |||
| 6. Trademarks. This License does not grant permission to use the trade | |||
| names, trademarks, service marks, or product names of the Licensor, | |||
| except as required for reasonable and customary use in describing the | |||
| origin of the Work and reproducing the content of the NOTICE file. | |||
| 7. Disclaimer of Warranty. Unless required by applicable law or | |||
| agreed to in writing, Licensor provides the Work (and each | |||
| Contributor provides its Contributions) on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |||
| implied, including, without limitation, any warranties or conditions | |||
| of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |||
| PARTICULAR PURPOSE. You are solely responsible for determining the | |||
| appropriateness of using or redistributing the Work and assume any | |||
| risks associated with Your exercise of permissions under this License. | |||
| 8. Limitation of Liability. In no event and under no legal theory, | |||
| whether in tort (including negligence), contract, or otherwise, | |||
| unless required by applicable law (such as deliberate and grossly | |||
| negligent acts) or agreed to in writing, shall any Contributor be | |||
| liable to You for damages, including any direct, indirect, special, | |||
| incidental, or consequential damages of any character arising as a | |||
| result of this License or out of the use or inability to use the | |||
| Work (including but not limited to damages for loss of goodwill, | |||
| work stoppage, computer failure or malfunction, or any and all | |||
| other commercial damages or losses), even if such Contributor | |||
| has been advised of the possibility of such damages. | |||
| 9. Accepting Warranty or Additional Liability. While redistributing | |||
| the Work or Derivative Works thereof, You may choose to offer, | |||
| and charge a fee for, acceptance of support, warranty, indemnity, | |||
| or other liability obligations and/or rights consistent with this | |||
| License. However, in accepting such obligations, You may act only | |||
| on Your own behalf and on Your sole responsibility, not on behalf | |||
| of any other Contributor, and only if You agree to indemnify, | |||
| defend, and hold each Contributor harmless for any liability | |||
| incurred by, or claims asserted against, such Contributor by reason | |||
| of your accepting any such warranty or additional liability. | |||
| END OF TERMS AND CONDITIONS | |||
| APPENDIX: How to apply the Apache License to your work. | |||
| To apply the Apache License to your work, attach the following | |||
| boilerplate notice, with the fields enclosed by brackets "{}" | |||
| replaced with your own identifying information. (Don't include | |||
| the brackets!) The text should be enclosed in the appropriate | |||
| comment syntax for the file format. We also recommend that a | |||
| file or class name and description of purpose be included on the | |||
| same "printed page" as the copyright notice for easier | |||
| identification within third-party archives. | |||
| Copyright {yyyy} {name of copyright owner} | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| ------------------ | |||
| internal/golang/* files licensed under: | |||
| Copyright (c) 2009 The Go Authors. All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without | |||
| modification, are permitted provided that the following conditions are | |||
| met: | |||
| * Redistributions of source code must retain the above copyright | |||
| notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above | |||
| copyright notice, this list of conditions and the following disclaimer | |||
| in the documentation and/or other materials provided with the | |||
| distribution. | |||
| * Neither the name of Google Inc. nor the names of its | |||
| contributors may be used to endorse or promote products derived from | |||
| this software without specific prior written permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| = vendor/sigs.k8s.io/json/LICENSE 545d3f23616dee7495323aeb0b098df3 | |||
| @@ -200,7 +200,7 @@ ifeq (, $(shell which controller-gen)) | |||
| CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ | |||
| cd $$CONTROLLER_GEN_TMP_DIR ;\ | |||
| go mod init tmp ;\ | |||
| go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\ | |||
| go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 ;\ | |||
| rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ | |||
| } | |||
| CONTROLLER_GEN=$(GOBIN)/controller-gen | |||
| @@ -14,7 +14,7 @@ | |||
| # Add cross buildx improvement | |||
| # _speed_buildx_for_go_ | |||
| FROM golang:1.16-alpine3.15 AS builder | |||
| FROM golang:1.22.9-alpine3.19 AS builder | |||
| LABEL stage=builder | |||
| ARG GO_LDFLAGS | |||
| @@ -31,7 +31,7 @@ RUN make build WHAT=gm GO_LDFLAGS=$GO_LDFLAGS OUT_DIR=_output | |||
| # ALT: just using go build | |||
| # RUN CGO_ENABLED=0 go build -o _output/bin/sedna-gm -ldflags "$GO_LDFLAGS -w -s" cmd/sedna-gm/sedna-gm.go | |||
| FROM alpine:3.11 | |||
| FROM alpine:3.19 | |||
| COPY --from=builder /code/_output/bin/sedna-gm /usr/local/bin/sedna-gm | |||
| @@ -15,7 +15,7 @@ | |||
| # Add cross buildx improvement | |||
| # LC has built sqlite3 which requires CGO with CGO_ENABLED=1 | |||
| # _speed_buildx_for_cgo_alpine_ | |||
| FROM golang:1.16-alpine3.15 AS builder | |||
| FROM golang:1.22.9-alpine3.19 AS builder | |||
| LABEL stage=builder | |||
| ARG GO_LDFLAGS | |||
| @@ -30,7 +30,7 @@ COPY . . | |||
| RUN make build WHAT=lc GO_LDFLAGS=$GO_LDFLAGS OUT_DIR=_output | |||
| FROM alpine:3.11 | |||
| FROM alpine:3.19 | |||
| COPY --from=builder /code/_output/bin/sedna-lc /usr/local/bin/sedna-lc | |||
| @@ -1,55 +1,92 @@ | |||
| module github.com/kubeedge/sedna | |||
| go 1.16 | |||
| go 1.22.9 | |||
| require ( | |||
| github.com/emicklei/go-restful/v3 v3.4.0 | |||
| github.com/gorilla/websocket v1.4.2 | |||
| github.com/emicklei/go-restful/v3 v3.11.0 | |||
| github.com/gorilla/websocket v1.5.0 | |||
| github.com/microcosm-cc/bluemonday v1.0.18 | |||
| github.com/minio/minio-go/v7 v7.0.10 | |||
| github.com/onsi/ginkgo v1.11.0 | |||
| github.com/onsi/gomega v1.7.0 | |||
| github.com/spf13/cobra v1.1.1 | |||
| github.com/onsi/gomega v1.31.0 | |||
| github.com/spf13/cobra v1.7.0 | |||
| github.com/spf13/pflag v1.0.5 | |||
| gorm.io/driver/sqlite v1.1.4 | |||
| gorm.io/gorm v1.20.9 | |||
| k8s.io/api v0.21.4 | |||
| k8s.io/apimachinery v0.21.4 | |||
| k8s.io/client-go v0.21.4 | |||
| k8s.io/code-generator v0.21.4 | |||
| k8s.io/component-base v0.21.4 | |||
| k8s.io/klog/v2 v2.8.0 | |||
| k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 | |||
| k8s.io/kubernetes v1.21.4 | |||
| sigs.k8s.io/yaml v1.2.0 | |||
| gorm.io/driver/sqlite v1.5.7 | |||
| gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde | |||
| k8s.io/api v0.30.7 | |||
| k8s.io/apimachinery v0.30.7 | |||
| k8s.io/client-go v0.30.7 | |||
| k8s.io/code-generator v0.30.7 | |||
| k8s.io/component-base v0.30.7 | |||
| k8s.io/klog/v2 v2.120.1 | |||
| k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 | |||
| sigs.k8s.io/yaml v1.3.0 | |||
| ) | |||
| replace ( | |||
| // https://github.com/kubernetes/kubernetes/issues/79384 | |||
| k8s.io/api => k8s.io/api v0.21.4 | |||
| k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.21.4 | |||
| k8s.io/apimachinery => k8s.io/apimachinery v0.21.4 | |||
| k8s.io/apiserver => k8s.io/apiserver v0.21.4 | |||
| k8s.io/cli-runtime => k8s.io/cli-runtime v0.21.4 | |||
| k8s.io/client-go => k8s.io/client-go v0.21.4 | |||
| k8s.io/cloud-provider => k8s.io/cloud-provider v0.21.4 | |||
| k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.21.4 | |||
| k8s.io/code-generator => k8s.io/code-generator v0.21.4 | |||
| k8s.io/component-base => k8s.io/component-base v0.21.4 | |||
| k8s.io/component-helpers => k8s.io/component-helpers v0.21.4 | |||
| k8s.io/controller-manager => k8s.io/controller-manager v0.21.4 | |||
| k8s.io/cri-api => k8s.io/cri-api v0.21.4 | |||
| k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.21.4 | |||
| k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.21.4 | |||
| k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.21.4 | |||
| k8s.io/kube-proxy => k8s.io/kube-proxy v0.21.4 | |||
| k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.21.4 | |||
| k8s.io/kubectl => k8s.io/kubectl v0.21.4 | |||
| k8s.io/kubelet => k8s.io/kubelet v0.21.4 | |||
| k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.21.4 | |||
| k8s.io/metrics => k8s.io/metrics v0.21.4 | |||
| k8s.io/mount-utils => k8s.io/mount-utils v0.21.4 | |||
| k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.21.4 | |||
| k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.21.4 | |||
| k8s.io/sample-controller => k8s.io/sample-controller v0.21.4 | |||
| require ( | |||
| github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect | |||
| github.com/aymerick/douceur v0.2.0 // indirect | |||
| github.com/beorn7/perks v1.0.1 // indirect | |||
| github.com/blang/semver/v4 v4.0.0 // indirect | |||
| github.com/cespare/xxhash/v2 v2.2.0 // indirect | |||
| github.com/davecgh/go-spew v1.1.1 // indirect | |||
| github.com/evanphx/json-patch v4.12.0+incompatible // indirect | |||
| github.com/fsnotify/fsnotify v1.8.0 // indirect | |||
| github.com/go-logr/logr v1.4.1 // indirect | |||
| github.com/go-openapi/jsonpointer v0.19.6 // indirect | |||
| github.com/go-openapi/jsonreference v0.20.2 // indirect | |||
| github.com/go-openapi/swag v0.22.3 // indirect | |||
| github.com/gogo/protobuf v1.3.2 // indirect | |||
| github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | |||
| github.com/golang/protobuf v1.5.4 // indirect | |||
| github.com/google/gnostic-models v0.6.8 // indirect | |||
| github.com/google/go-cmp v0.6.0 // indirect | |||
| github.com/google/gofuzz v1.2.0 // indirect | |||
| github.com/google/uuid v1.3.0 // indirect | |||
| github.com/gorilla/css v1.0.0 // indirect | |||
| github.com/hpcloud/tail v1.0.0 // indirect | |||
| github.com/imdario/mergo v0.3.6 // indirect | |||
| github.com/inconshreveable/mousetrap v1.1.0 // indirect | |||
| github.com/jinzhu/inflection v1.0.0 // indirect | |||
| github.com/jinzhu/now v1.1.5 // indirect | |||
| github.com/josharian/intern v1.0.0 // indirect | |||
| github.com/json-iterator/go v1.1.12 // indirect | |||
| github.com/klauspost/cpuid v1.3.1 // indirect | |||
| github.com/mailru/easyjson v0.7.7 // indirect | |||
| github.com/mattn/go-sqlite3 v1.14.22 // indirect | |||
| github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect | |||
| github.com/minio/md5-simd v1.1.0 // indirect | |||
| github.com/minio/sha256-simd v0.1.1 // indirect | |||
| github.com/mitchellh/go-homedir v1.1.0 // indirect | |||
| github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect | |||
| github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | |||
| github.com/modern-go/reflect2 v1.0.2 // indirect | |||
| github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect | |||
| github.com/pkg/errors v0.9.1 // indirect | |||
| github.com/prometheus/client_golang v1.16.0 // indirect | |||
| github.com/prometheus/client_model v0.4.0 // indirect | |||
| github.com/prometheus/common v0.44.0 // indirect | |||
| github.com/prometheus/procfs v0.10.1 // indirect | |||
| github.com/rs/xid v1.2.1 // indirect | |||
| golang.org/x/crypto v0.21.0 // indirect | |||
| golang.org/x/mod v0.15.0 // indirect | |||
| golang.org/x/net v0.23.0 // indirect | |||
| golang.org/x/oauth2 v0.10.0 // indirect | |||
| golang.org/x/sys v0.18.0 // indirect | |||
| golang.org/x/term v0.18.0 // indirect | |||
| golang.org/x/text v0.14.0 // indirect | |||
| golang.org/x/time v0.3.0 // indirect | |||
| golang.org/x/tools v0.18.0 // indirect | |||
| google.golang.org/appengine v1.6.7 // indirect | |||
| google.golang.org/protobuf v1.33.0 // indirect | |||
| gopkg.in/fsnotify.v1 v1.4.7 // indirect | |||
| gopkg.in/inf.v0 v0.9.1 // indirect | |||
| gopkg.in/ini.v1 v1.57.0 // indirect | |||
| gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect | |||
| gopkg.in/yaml.v2 v2.4.0 // indirect | |||
| gopkg.in/yaml.v3 v3.0.1 // indirect | |||
| k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect | |||
| k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect | |||
| sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect | |||
| sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect | |||
| ) | |||
| @@ -47,7 +47,7 @@ shift 4 | |||
| # To support running this script from anywhere, we have to first cd into this directory | |||
| # so we can install the tools. | |||
| cd "$(dirname "${0}")" | |||
| GO111MODULE=on go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} | |||
| GOFLAGS=-mod=vendor go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} | |||
| ) | |||
| function codegen::join() { local IFS="$1"; shift; echo "$*"; } | |||
| @@ -65,25 +65,34 @@ done | |||
| if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then | |||
| echo "Generating deepcopy funcs" | |||
| "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" | |||
| "${GOPATH}/bin/deepcopy-gen" --output-file zz_generated.deepcopy.go "${FQ_APIS[@]}" "$@" | |||
| fi | |||
| if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then | |||
| echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" | |||
| "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" | |||
| "${GOPATH}/bin/client-gen" \ | |||
| --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" \ | |||
| --input-base "" \ | |||
| --input "$(codegen::join , "${FQ_APIS[@]}")" \ | |||
| --output-pkg "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" \ | |||
| --output-dir "pkg/client/${CLIENTSET_PKG_NAME:-clientset}" \ | |||
| "$@" | |||
| fi | |||
| if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then | |||
| echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" | |||
| "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" | |||
| "${GOPATH}/bin/lister-gen" \ | |||
| --output-pkg "${OUTPUT_PKG}/listers" "$@" \ | |||
| --output-dir "pkg/client/listers" \ | |||
| "${FQ_APIS[@]}" "$@" | |||
| fi | |||
| if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then | |||
| echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" | |||
| "${GOPATH}/bin/informer-gen" \ | |||
| --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \ | |||
| --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ | |||
| --listers-package "${OUTPUT_PKG}/listers" \ | |||
| --output-package "${OUTPUT_PKG}/informers" \ | |||
| "$@" | |||
| --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ | |||
| --listers-package "${OUTPUT_PKG}/listers" \ | |||
| --output-pkg "${OUTPUT_PKG}/informers" \ | |||
| --output-dir "pkg/client/informers" \ | |||
| "${FQ_APIS[@]}" "$@" | |||
| fi | |||
| @@ -26,7 +26,7 @@ export PATH=$PATH:$(go env GOPATH)/bin | |||
| install_golangci-lint() { | |||
| echo "installing golangci-lint." | |||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.34.1 | |||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 | |||
| if [[ $? -ne 0 ]]; then | |||
| echo "failed to install golangci-lint, exiting." | |||
| exit 1 | |||
| @@ -23,20 +23,6 @@ SEDNA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | |||
| source ${SEDNA_ROOT}/hack/lib/init.sh | |||
| ${SEDNA_ROOT}/hack/generate-groups.sh "deepcopy,client,informer,lister" \ | |||
| ${SEDNA_GO_PACKAGE}/pkg/client ${SEDNA_GO_PACKAGE}/pkg/apis \ | |||
| "sedna:v1alpha1" \ | |||
| --go-header-file ${SEDNA_ROOT}/hack/boilerplate/boilerplate.generatego.txt | |||
| # Check if Sedna home is different from the standard directory where GO projects are located | |||
| if ! [[ "${GOPATH}/src/${SEDNA_GO_PACKAGE}/" -ef "${SEDNA_ROOT}/" ]]; then | |||
| # Copy generated code into SEDNA_ROOT | |||
| echo "Warning: ${SEDNA_ROOT} not included in $GOPATH which is required by code-gen" | |||
| echo "Moving generated code from ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/ to ${SEDNA_ROOT}/" | |||
| rsync -a ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis} ${SEDNA_ROOT}/pkg | |||
| if [ $? -eq 0 ]; then | |||
| echo "Copy successful!" | |||
| rm -rf ${GOPATH}/src/${SEDNA_GO_PACKAGE}/pkg/{client,apis} | |||
| else | |||
| echo "Error during copy of the generated code!" >&2 | |||
| fi | |||
| fi | |||
| ${SEDNA_GO_PACKAGE}/pkg/client ${SEDNA_GO_PACKAGE}/pkg/apis \ | |||
| "sedna:v1alpha1" \ | |||
| --go-header-file ${SEDNA_ROOT}/hack/boilerplate/boilerplate.generatego.txt | |||
| @@ -31,15 +31,14 @@ | |||
| # KubeEdge Authors: | |||
| # - File derived from kubernetes v1.19.0-beta.2 | |||
| # - Changed KUBE_ROOT value to use absolute path | |||
| # - skip license for k8s.io/klog | |||
| set -o errexit | |||
| set -o nounset | |||
| set -o pipefail | |||
| KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | |||
| source "${KUBE_ROOT}/hack/lib/util.sh" | |||
| KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | |||
| source "${KUBE_ROOT}/hack/lib/init.sh" | |||
| export LANG=C | |||
| export LC_ALL=C | |||
| @@ -143,7 +142,7 @@ process_content () { | |||
| ############################################################################# | |||
| export GO111MODULE=on | |||
| export GOFLAGS=-mod=mod | |||
| export GOFLAGS=-mod=readonly | |||
| # Check bash version | |||
| if (( BASH_VERSINFO[0] < 4 )); then | |||
| @@ -165,7 +164,7 @@ cd "${LICENSE_ROOT}" | |||
| kube::util::ensure-temp-dir | |||
| # Save the genreated LICENSE file for each package temporarily | |||
| # Save the generated LICENSE file for each package temporarily | |||
| TMP_LICENSE_FILE="${KUBE_TEMP}/LICENSES.$$" | |||
| # The directory to save all the LICENSE files | |||
| @@ -193,8 +192,10 @@ if [ -f "${LICENSE_ROOT}/LICENSE" ]; then | |||
| mv "${TMP_LICENSE_FILE}" "${TMP_LICENSES_DIR}/LICENSE" | |||
| fi | |||
| # Capture all module dependencies | |||
| modules=$(go list -m -json all | jq -r .Path | sort -f) | |||
| # Loop through every vendored package | |||
| for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do | |||
| for PACKAGE in ${modules}; do | |||
| if [[ -e "staging/src/${PACKAGE}" ]]; then | |||
| echo "${PACKAGE} is a staging package, skipping" >&2 | |||
| continue | |||
| @@ -203,34 +204,15 @@ for PACKAGE in $(go list -m -json all | jq -r .Path | sort -f); do | |||
| echo "${PACKAGE} doesn't exist in ${DEPS_DIR}, skipping" >&2 | |||
| continue | |||
| fi | |||
| if [[ "${PACKAGE}" = "sigs.k8s.io/structured-merge-diff" ]]; then | |||
| # this package doesn't exist, but has v3 subdirectory as a different package | |||
| # so it can't be filtered by the previous rule | |||
| # temporarily treat this way until find out a better rule | |||
| echo "${PACKAGE}, temporarily skipping" >&2 | |||
| continue | |||
| fi | |||
| if [[ "${PACKAGE}" = "github.com/cespare/xxhash" ]]; then | |||
| # there are 2 versions v1 and v2 under 2 folders indirectly used | |||
| # so it can't be filtered by the previous rule | |||
| # temporarily treat this way until find out a better rule | |||
| echo "${PACKAGE}, temporarily skipping" >&2 | |||
| continue | |||
| fi | |||
| if [[ "${PACKAGE}" = "k8s.io/klog" ]]; then | |||
| # this package doesn't use, but has v2 subdirectory as a different package | |||
| # so it can't be filtered by the previous rule | |||
| # temporarily treat this way until find out a better rule | |||
| echo "${PACKAGE}, temporarily skipping" >&2 | |||
| continue | |||
| fi | |||
| if [[ "${PACKAGE}" = "github.com/emicklei/go-restful" ]]; then | |||
| # this package doesn't use, but has v3 subdirectory as a different package | |||
| # so it can't be filtered by the previous rule | |||
| # temporarily treat this way until find out a better rule | |||
| echo "${PACKAGE}, temporarily skipping" >&2 | |||
| continue | |||
| # if there are no files vendored under this package... | |||
| if [[ -z "$(find "${DEPS_DIR}/${PACKAGE}" -mindepth 1 -maxdepth 1 -type f)" ]]; then | |||
| # and we have at least the same number of submodules as subdirectories... | |||
| if [[ "$(find "${DEPS_DIR}/${PACKAGE}/" -mindepth 1 -maxdepth 1 -type d | wc -l)" -le "$(echo "${modules}" | grep -cE "^${PACKAGE}/")" ]]; then | |||
| echo "Only submodules of ${PACKAGE} are vendored, skipping" >&2 | |||
| continue | |||
| fi | |||
| fi | |||
| echo "${PACKAGE}" | |||
| process_content "${PACKAGE}" LICENSE | |||
| @@ -8,7 +8,7 @@ SEDNA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" | |||
| UPDATE_SCRIPT=hack/update-vendor.sh | |||
| ${SEDNA_ROOT}/${UPDATE_SCRIPT} | |||
| if git status --short 2>/dev/null | grep -qE 'go\.mod|go\.sum|vendor/'; then | |||
| echo "FAILED: vendor verify failed." >&2 | |||
| echo "Please run the command to update your vendor directories: $UPDATE_SCRIPT" >&2 | |||
| @@ -1,3 +1,4 @@ | |||
| //go:build !ignore_autogenerated | |||
| // +build !ignore_autogenerated | |||
| /* | |||
| @@ -20,6 +20,7 @@ package versioned | |||
| import ( | |||
| "fmt" | |||
| "net/http" | |||
| sednav1alpha1 "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| discovery "k8s.io/client-go/discovery" | |||
| @@ -32,8 +33,7 @@ type Interface interface { | |||
| SednaV1alpha1() sednav1alpha1.SednaV1alpha1Interface | |||
| } | |||
| // Clientset contains the clients for groups. Each group has exactly one | |||
| // version included in a Clientset. | |||
| // Clientset contains the clients for groups. | |||
| type Clientset struct { | |||
| *discovery.DiscoveryClient | |||
| sednaV1alpha1 *sednav1alpha1.SednaV1alpha1Client | |||
| @@ -55,22 +55,45 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { | |||
| // NewForConfig creates a new Clientset for the given config. | |||
| // If config's RateLimiter is not set and QPS and Burst are acceptable, | |||
| // NewForConfig will generate a rate-limiter in configShallowCopy. | |||
| // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), | |||
| // where httpClient was generated with rest.HTTPClientFor(c). | |||
| func NewForConfig(c *rest.Config) (*Clientset, error) { | |||
| configShallowCopy := *c | |||
| if configShallowCopy.UserAgent == "" { | |||
| configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() | |||
| } | |||
| // share the transport between all clients | |||
| httpClient, err := rest.HTTPClientFor(&configShallowCopy) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return NewForConfigAndClient(&configShallowCopy, httpClient) | |||
| } | |||
| // NewForConfigAndClient creates a new Clientset for the given config and http client. | |||
| // Note the http client provided takes precedence over the configured transport values. | |||
| // If config's RateLimiter is not set and QPS and Burst are acceptable, | |||
| // NewForConfigAndClient will generate a rate-limiter in configShallowCopy. | |||
| func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { | |||
| configShallowCopy := *c | |||
| if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { | |||
| if configShallowCopy.Burst <= 0 { | |||
| return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") | |||
| } | |||
| configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) | |||
| } | |||
| var cs Clientset | |||
| var err error | |||
| cs.sednaV1alpha1, err = sednav1alpha1.NewForConfig(&configShallowCopy) | |||
| cs.sednaV1alpha1, err = sednav1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) | |||
| cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| @@ -80,11 +103,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { | |||
| // NewForConfigOrDie creates a new Clientset for the given config and | |||
| // panics if there is an error in the config. | |||
| func NewForConfigOrDie(c *rest.Config) *Clientset { | |||
| var cs Clientset | |||
| cs.sednaV1alpha1 = sednav1alpha1.NewForConfigOrDie(c) | |||
| cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) | |||
| return &cs | |||
| cs, err := NewForConfig(c) | |||
| if err != nil { | |||
| panic(err) | |||
| } | |||
| return cs | |||
| } | |||
| // New creates a new Clientset for the given RESTClient. | |||
| @@ -1,20 +0,0 @@ | |||
| /* | |||
| Copyright The KubeEdge Authors. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| */ | |||
| // Code generated by client-gen. DO NOT EDIT. | |||
| // This package has the automatically generated clientset. | |||
| package versioned | |||
| @@ -74,7 +74,10 @@ func (c *Clientset) Tracker() testing.ObjectTracker { | |||
| return c.tracker | |||
| } | |||
| var _ clientset.Interface = &Clientset{} | |||
| var ( | |||
| _ clientset.Interface = &Clientset{} | |||
| _ testing.FakeClient = &Clientset{} | |||
| ) | |||
| // SednaV1alpha1 retrieves the SednaV1alpha1Client | |||
| func (c *Clientset) SednaV1alpha1() sednav1alpha1.SednaV1alpha1Interface { | |||
| @@ -37,14 +37,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ | |||
| // AddToScheme adds all types of this clientset into the given scheme. This allows composition | |||
| // of clientsets, like in: | |||
| // | |||
| // import ( | |||
| // "k8s.io/client-go/kubernetes" | |||
| // clientsetscheme "k8s.io/client-go/kubernetes/scheme" | |||
| // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" | |||
| // ) | |||
| // import ( | |||
| // "k8s.io/client-go/kubernetes" | |||
| // clientsetscheme "k8s.io/client-go/kubernetes/scheme" | |||
| // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" | |||
| // ) | |||
| // | |||
| // kclientset, _ := kubernetes.NewForConfig(c) | |||
| // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) | |||
| // kclientset, _ := kubernetes.NewForConfig(c) | |||
| // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) | |||
| // | |||
| // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types | |||
| // correctly. | |||
| @@ -37,14 +37,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{ | |||
| // AddToScheme adds all types of this clientset into the given scheme. This allows composition | |||
| // of clientsets, like in: | |||
| // | |||
| // import ( | |||
| // "k8s.io/client-go/kubernetes" | |||
| // clientsetscheme "k8s.io/client-go/kubernetes/scheme" | |||
| // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" | |||
| // ) | |||
| // import ( | |||
| // "k8s.io/client-go/kubernetes" | |||
| // clientsetscheme "k8s.io/client-go/kubernetes/scheme" | |||
| // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" | |||
| // ) | |||
| // | |||
| // kclientset, _ := kubernetes.NewForConfig(c) | |||
| // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) | |||
| // kclientset, _ := kubernetes.NewForConfig(c) | |||
| // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) | |||
| // | |||
| // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types | |||
| // correctly. | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeDatasets struct { | |||
| ns string | |||
| } | |||
| var datasetsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "datasets"} | |||
| var datasetsResource = v1alpha1.SchemeGroupVersion.WithResource("datasets") | |||
| var datasetsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "Dataset"} | |||
| var datasetsKind = v1alpha1.SchemeGroupVersion.WithKind("Dataset") | |||
| // Get takes name of the dataset, and returns the corresponding dataset object, and an error if there is any. | |||
| func (c *FakeDatasets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Dataset, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeDatasets) UpdateStatus(ctx context.Context, dataset *v1alpha1.Datas | |||
| // Delete takes name of the dataset and deletes it. Returns an error if one occurs. | |||
| func (c *FakeDatasets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(datasetsResource, c.ns, name), &v1alpha1.Dataset{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(datasetsResource, c.ns, name, opts), &v1alpha1.Dataset{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeFeatureExtractionServices struct { | |||
| ns string | |||
| } | |||
| var featureextractionservicesResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "featureextractionservices"} | |||
| var featureextractionservicesResource = v1alpha1.SchemeGroupVersion.WithResource("featureextractionservices") | |||
| var featureextractionservicesKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "FeatureExtractionService"} | |||
| var featureextractionservicesKind = v1alpha1.SchemeGroupVersion.WithKind("FeatureExtractionService") | |||
| // Get takes name of the featureExtractionService, and returns the corresponding featureExtractionService object, and an error if there is any. | |||
| func (c *FakeFeatureExtractionServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FeatureExtractionService, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeFeatureExtractionServices) UpdateStatus(ctx context.Context, featur | |||
| // Delete takes name of the featureExtractionService and deletes it. Returns an error if one occurs. | |||
| func (c *FakeFeatureExtractionServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(featureextractionservicesResource, c.ns, name), &v1alpha1.FeatureExtractionService{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(featureextractionservicesResource, c.ns, name, opts), &v1alpha1.FeatureExtractionService{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeFederatedLearningJobs struct { | |||
| ns string | |||
| } | |||
| var federatedlearningjobsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "federatedlearningjobs"} | |||
| var federatedlearningjobsResource = v1alpha1.SchemeGroupVersion.WithResource("federatedlearningjobs") | |||
| var federatedlearningjobsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "FederatedLearningJob"} | |||
| var federatedlearningjobsKind = v1alpha1.SchemeGroupVersion.WithKind("FederatedLearningJob") | |||
| // Get takes name of the federatedLearningJob, and returns the corresponding federatedLearningJob object, and an error if there is any. | |||
| func (c *FakeFederatedLearningJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FederatedLearningJob, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeFederatedLearningJobs) UpdateStatus(ctx context.Context, federatedL | |||
| // Delete takes name of the federatedLearningJob and deletes it. Returns an error if one occurs. | |||
| func (c *FakeFederatedLearningJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(federatedlearningjobsResource, c.ns, name), &v1alpha1.FederatedLearningJob{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(federatedlearningjobsResource, c.ns, name, opts), &v1alpha1.FederatedLearningJob{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeIncrementalLearningJobs struct { | |||
| ns string | |||
| } | |||
| var incrementallearningjobsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "incrementallearningjobs"} | |||
| var incrementallearningjobsResource = v1alpha1.SchemeGroupVersion.WithResource("incrementallearningjobs") | |||
| var incrementallearningjobsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "IncrementalLearningJob"} | |||
| var incrementallearningjobsKind = v1alpha1.SchemeGroupVersion.WithKind("IncrementalLearningJob") | |||
| // Get takes name of the incrementalLearningJob, and returns the corresponding incrementalLearningJob object, and an error if there is any. | |||
| func (c *FakeIncrementalLearningJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IncrementalLearningJob, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeIncrementalLearningJobs) UpdateStatus(ctx context.Context, incremen | |||
| // Delete takes name of the incrementalLearningJob and deletes it. Returns an error if one occurs. | |||
| func (c *FakeIncrementalLearningJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(incrementallearningjobsResource, c.ns, name), &v1alpha1.IncrementalLearningJob{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(incrementallearningjobsResource, c.ns, name, opts), &v1alpha1.IncrementalLearningJob{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeJointInferenceServices struct { | |||
| ns string | |||
| } | |||
| var jointinferenceservicesResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "jointinferenceservices"} | |||
| var jointinferenceservicesResource = v1alpha1.SchemeGroupVersion.WithResource("jointinferenceservices") | |||
| var jointinferenceservicesKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "JointInferenceService"} | |||
| var jointinferenceservicesKind = v1alpha1.SchemeGroupVersion.WithKind("JointInferenceService") | |||
| // Get takes name of the jointInferenceService, and returns the corresponding jointInferenceService object, and an error if there is any. | |||
| func (c *FakeJointInferenceServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.JointInferenceService, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeJointInferenceServices) UpdateStatus(ctx context.Context, jointInfe | |||
| // Delete takes name of the jointInferenceService and deletes it. Returns an error if one occurs. | |||
| func (c *FakeJointInferenceServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(jointinferenceservicesResource, c.ns, name), &v1alpha1.JointInferenceService{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(jointinferenceservicesResource, c.ns, name, opts), &v1alpha1.JointInferenceService{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeLifelongLearningJobs struct { | |||
| ns string | |||
| } | |||
| var lifelonglearningjobsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "lifelonglearningjobs"} | |||
| var lifelonglearningjobsResource = v1alpha1.SchemeGroupVersion.WithResource("lifelonglearningjobs") | |||
| var lifelonglearningjobsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "LifelongLearningJob"} | |||
| var lifelonglearningjobsKind = v1alpha1.SchemeGroupVersion.WithKind("LifelongLearningJob") | |||
| // Get takes name of the lifelongLearningJob, and returns the corresponding lifelongLearningJob object, and an error if there is any. | |||
| func (c *FakeLifelongLearningJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LifelongLearningJob, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeLifelongLearningJobs) UpdateStatus(ctx context.Context, lifelongLea | |||
| // Delete takes name of the lifelongLearningJob and deletes it. Returns an error if one occurs. | |||
| func (c *FakeLifelongLearningJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(lifelonglearningjobsResource, c.ns, name), &v1alpha1.LifelongLearningJob{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(lifelonglearningjobsResource, c.ns, name, opts), &v1alpha1.LifelongLearningJob{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeModels struct { | |||
| ns string | |||
| } | |||
| var modelsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "models"} | |||
| var modelsResource = v1alpha1.SchemeGroupVersion.WithResource("models") | |||
| var modelsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "Model"} | |||
| var modelsKind = v1alpha1.SchemeGroupVersion.WithKind("Model") | |||
| // Get takes name of the model, and returns the corresponding model object, and an error if there is any. | |||
| func (c *FakeModels) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Model, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeModels) UpdateStatus(ctx context.Context, model *v1alpha1.Model, op | |||
| // Delete takes name of the model and deletes it. Returns an error if one occurs. | |||
| func (c *FakeModels) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(modelsResource, c.ns, name), &v1alpha1.Model{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(modelsResource, c.ns, name, opts), &v1alpha1.Model{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeObjectSearchServices struct { | |||
| ns string | |||
| } | |||
| var objectsearchservicesResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "objectsearchservices"} | |||
| var objectsearchservicesResource = v1alpha1.SchemeGroupVersion.WithResource("objectsearchservices") | |||
| var objectsearchservicesKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "ObjectSearchService"} | |||
| var objectsearchservicesKind = v1alpha1.SchemeGroupVersion.WithKind("ObjectSearchService") | |||
| // Get takes name of the objectSearchService, and returns the corresponding objectSearchService object, and an error if there is any. | |||
| func (c *FakeObjectSearchServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ObjectSearchService, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeObjectSearchServices) UpdateStatus(ctx context.Context, objectSearc | |||
| // Delete takes name of the objectSearchService and deletes it. Returns an error if one occurs. | |||
| func (c *FakeObjectSearchServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(objectsearchservicesResource, c.ns, name), &v1alpha1.ObjectSearchService{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(objectsearchservicesResource, c.ns, name, opts), &v1alpha1.ObjectSearchService{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeObjectTrackingServices struct { | |||
| ns string | |||
| } | |||
| var objecttrackingservicesResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "objecttrackingservices"} | |||
| var objecttrackingservicesResource = v1alpha1.SchemeGroupVersion.WithResource("objecttrackingservices") | |||
| var objecttrackingservicesKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "ObjectTrackingService"} | |||
| var objecttrackingservicesKind = v1alpha1.SchemeGroupVersion.WithKind("ObjectTrackingService") | |||
| // Get takes name of the objectTrackingService, and returns the corresponding objectTrackingService object, and an error if there is any. | |||
| func (c *FakeObjectTrackingServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ObjectTrackingService, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeObjectTrackingServices) UpdateStatus(ctx context.Context, objectTra | |||
| // Delete takes name of the objectTrackingService and deletes it. Returns an error if one occurs. | |||
| func (c *FakeObjectTrackingServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(objecttrackingservicesResource, c.ns, name), &v1alpha1.ObjectTrackingService{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(objecttrackingservicesResource, c.ns, name, opts), &v1alpha1.ObjectTrackingService{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeReidJobs struct { | |||
| ns string | |||
| } | |||
| var reidjobsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "reidjobs"} | |||
| var reidjobsResource = v1alpha1.SchemeGroupVersion.WithResource("reidjobs") | |||
| var reidjobsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "ReidJob"} | |||
| var reidjobsKind = v1alpha1.SchemeGroupVersion.WithKind("ReidJob") | |||
| // Get takes name of the reidJob, and returns the corresponding reidJob object, and an error if there is any. | |||
| func (c *FakeReidJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ReidJob, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeReidJobs) UpdateStatus(ctx context.Context, reidJob *v1alpha1.ReidJ | |||
| // Delete takes name of the reidJob and deletes it. Returns an error if one occurs. | |||
| func (c *FakeReidJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(reidjobsResource, c.ns, name), &v1alpha1.ReidJob{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(reidjobsResource, c.ns, name, opts), &v1alpha1.ReidJob{}) | |||
| return err | |||
| } | |||
| @@ -24,7 +24,6 @@ import ( | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| labels "k8s.io/apimachinery/pkg/labels" | |||
| schema "k8s.io/apimachinery/pkg/runtime/schema" | |||
| types "k8s.io/apimachinery/pkg/types" | |||
| watch "k8s.io/apimachinery/pkg/watch" | |||
| testing "k8s.io/client-go/testing" | |||
| @@ -36,9 +35,9 @@ type FakeVideoAnalyticsJobs struct { | |||
| ns string | |||
| } | |||
| var videoanalyticsjobsResource = schema.GroupVersionResource{Group: "sedna.io", Version: "v1alpha1", Resource: "videoanalyticsjobs"} | |||
| var videoanalyticsjobsResource = v1alpha1.SchemeGroupVersion.WithResource("videoanalyticsjobs") | |||
| var videoanalyticsjobsKind = schema.GroupVersionKind{Group: "sedna.io", Version: "v1alpha1", Kind: "VideoAnalyticsJob"} | |||
| var videoanalyticsjobsKind = v1alpha1.SchemeGroupVersion.WithKind("VideoAnalyticsJob") | |||
| // Get takes name of the videoAnalyticsJob, and returns the corresponding videoAnalyticsJob object, and an error if there is any. | |||
| func (c *FakeVideoAnalyticsJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VideoAnalyticsJob, err error) { | |||
| @@ -117,7 +116,7 @@ func (c *FakeVideoAnalyticsJobs) UpdateStatus(ctx context.Context, videoAnalytic | |||
| // Delete takes name of the videoAnalyticsJob and deletes it. Returns an error if one occurs. | |||
| func (c *FakeVideoAnalyticsJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { | |||
| _, err := c.Fake. | |||
| Invokes(testing.NewDeleteAction(videoanalyticsjobsResource, c.ns, name), &v1alpha1.VideoAnalyticsJob{}) | |||
| Invokes(testing.NewDeleteActionWithOptions(videoanalyticsjobsResource, c.ns, name, opts), &v1alpha1.VideoAnalyticsJob{}) | |||
| return err | |||
| } | |||
| @@ -19,6 +19,8 @@ limitations under the License. | |||
| package v1alpha1 | |||
| import ( | |||
| "net/http" | |||
| v1alpha1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| "github.com/kubeedge/sedna/pkg/client/clientset/versioned/scheme" | |||
| rest "k8s.io/client-go/rest" | |||
| @@ -89,12 +91,28 @@ func (c *SednaV1alpha1Client) VideoAnalyticsJobs(namespace string) VideoAnalytic | |||
| } | |||
| // NewForConfig creates a new SednaV1alpha1Client for the given config. | |||
| // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), | |||
| // where httpClient was generated with rest.HTTPClientFor(c). | |||
| func NewForConfig(c *rest.Config) (*SednaV1alpha1Client, error) { | |||
| config := *c | |||
| if err := setConfigDefaults(&config); err != nil { | |||
| return nil, err | |||
| } | |||
| client, err := rest.RESTClientFor(&config) | |||
| httpClient, err := rest.HTTPClientFor(&config) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return NewForConfigAndClient(&config, httpClient) | |||
| } | |||
| // NewForConfigAndClient creates a new SednaV1alpha1Client for the given config and http client. | |||
| // Note the http client provided takes precedence over the configured transport values. | |||
| func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SednaV1alpha1Client, error) { | |||
| config := *c | |||
| if err := setConfigDefaults(&config); err != nil { | |||
| return nil, err | |||
| } | |||
| client, err := rest.RESTClientForConfigAndClient(&config, h) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| @@ -42,11 +42,17 @@ type sharedInformerFactory struct { | |||
| lock sync.Mutex | |||
| defaultResync time.Duration | |||
| customResync map[reflect.Type]time.Duration | |||
| transform cache.TransformFunc | |||
| informers map[reflect.Type]cache.SharedIndexInformer | |||
| // startedInformers is used for tracking which informers have been started. | |||
| // This allows Start() to be called multiple times safely. | |||
| startedInformers map[reflect.Type]bool | |||
| // wg tracks how many goroutines were started. | |||
| wg sync.WaitGroup | |||
| // shuttingDown is true when Shutdown has been called. It may still be running | |||
| // because it needs to wait for goroutines. | |||
| shuttingDown bool | |||
| } | |||
| // WithCustomResyncConfig sets a custom resync period for the specified informer types. | |||
| @@ -75,6 +81,14 @@ func WithNamespace(namespace string) SharedInformerOption { | |||
| } | |||
| } | |||
| // WithTransform sets a transform on all informers. | |||
| func WithTransform(transform cache.TransformFunc) SharedInformerOption { | |||
| return func(factory *sharedInformerFactory) *sharedInformerFactory { | |||
| factory.transform = transform | |||
| return factory | |||
| } | |||
| } | |||
| // NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. | |||
| func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { | |||
| return NewSharedInformerFactoryWithOptions(client, defaultResync) | |||
| @@ -107,20 +121,39 @@ func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResy | |||
| return factory | |||
| } | |||
| // Start initializes all requested informers. | |||
| func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { | |||
| f.lock.Lock() | |||
| defer f.lock.Unlock() | |||
| if f.shuttingDown { | |||
| return | |||
| } | |||
| for informerType, informer := range f.informers { | |||
| if !f.startedInformers[informerType] { | |||
| go informer.Run(stopCh) | |||
| f.wg.Add(1) | |||
| // We need a new variable in each loop iteration, | |||
| // otherwise the goroutine would use the loop variable | |||
| // and that keeps changing. | |||
| informer := informer | |||
| go func() { | |||
| defer f.wg.Done() | |||
| informer.Run(stopCh) | |||
| }() | |||
| f.startedInformers[informerType] = true | |||
| } | |||
| } | |||
| } | |||
| // WaitForCacheSync waits for all started informers' cache were synced. | |||
| func (f *sharedInformerFactory) Shutdown() { | |||
| f.lock.Lock() | |||
| f.shuttingDown = true | |||
| f.lock.Unlock() | |||
| // Will return immediately if there is nothing to wait for. | |||
| f.wg.Wait() | |||
| } | |||
| func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { | |||
| informers := func() map[reflect.Type]cache.SharedIndexInformer { | |||
| f.lock.Lock() | |||
| @@ -142,7 +175,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref | |||
| return res | |||
| } | |||
| // InternalInformerFor returns the SharedIndexInformer for obj using an internal | |||
| // InformerFor returns the SharedIndexInformer for obj using an internal | |||
| // client. | |||
| func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { | |||
| f.lock.Lock() | |||
| @@ -160,6 +193,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal | |||
| } | |||
| informer = newFunc(f.client, resyncPeriod) | |||
| informer.SetTransform(f.transform) | |||
| f.informers[informerType] = informer | |||
| return informer | |||
| @@ -167,11 +201,58 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal | |||
| // SharedInformerFactory provides shared informers for resources in all known | |||
| // API group versions. | |||
| // | |||
| // It is typically used like this: | |||
| // | |||
| // ctx, cancel := context.Background() | |||
| // defer cancel() | |||
| // factory := NewSharedInformerFactory(client, resyncPeriod) | |||
| // defer factory.WaitForStop() // Returns immediately if nothing was started. | |||
| // genericInformer := factory.ForResource(resource) | |||
| // typedInformer := factory.SomeAPIGroup().V1().SomeType() | |||
| // factory.Start(ctx.Done()) // Start processing these informers. | |||
| // synced := factory.WaitForCacheSync(ctx.Done()) | |||
| // for v, ok := range synced { | |||
| // if !ok { | |||
| // fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) | |||
| // return | |||
| // } | |||
| // } | |||
| // | |||
| // // Creating informers can also be created after Start, but then | |||
| // // Start must be called again: | |||
| // anotherGenericInformer := factory.ForResource(resource) | |||
| // factory.Start(ctx.Done()) | |||
| type SharedInformerFactory interface { | |||
| internalinterfaces.SharedInformerFactory | |||
| ForResource(resource schema.GroupVersionResource) (GenericInformer, error) | |||
| // Start initializes all requested informers. They are handled in goroutines | |||
| // which run until the stop channel gets closed. | |||
| Start(stopCh <-chan struct{}) | |||
| // Shutdown marks a factory as shutting down. At that point no new | |||
| // informers can be started anymore and Start will return without | |||
| // doing anything. | |||
| // | |||
| // In addition, Shutdown blocks until all goroutines have terminated. For that | |||
| // to happen, the close channel(s) that they were started with must be closed, | |||
| // either before Shutdown gets called or while it is waiting. | |||
| // | |||
| // Shutdown may be called multiple times, even concurrently. All such calls will | |||
| // block until all goroutines have terminated. | |||
| Shutdown() | |||
| // WaitForCacheSync blocks until all started informers' caches were synced | |||
| // or the stop channel gets closed. | |||
| WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool | |||
| // ForResource gives generic access to a shared informer of the matching type. | |||
| ForResource(resource schema.GroupVersionResource) (GenericInformer, error) | |||
| // InformerFor returns the SharedIndexInformer for obj using an internal | |||
| // client. | |||
| InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer | |||
| Sedna() sedna.Interface | |||
| } | |||
| @@ -40,7 +40,6 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| @@ -186,7 +185,7 @@ func (c *Controller) updateDeployment(old, cur interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -39,13 +39,13 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| sednav1listers "github.com/kubeedge/sedna/pkg/client/listers/sedna/v1alpha1" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/config" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/runtime" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/utils" | |||
| ) | |||
| const ( | |||
| @@ -250,7 +250,7 @@ func (c *Controller) deletePod(obj interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -331,7 +331,7 @@ func (c *Controller) sync(key string) (bool, error) { | |||
| return false, err | |||
| } | |||
| activePods := k8scontroller.FilterActivePods(pods) | |||
| activePods := utils.FilterActivePods(pods) | |||
| active := int32(len(activePods)) | |||
| var activeAgg int32 | |||
| var activeTrain int32 | |||
| @@ -38,7 +38,6 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| @@ -192,7 +191,7 @@ func (c *Controller) deletePod(obj interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err)) | |||
| return | |||
| @@ -41,7 +41,6 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| @@ -121,7 +120,7 @@ func (c *Controller) Run(stopCh <-chan struct{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -39,7 +39,6 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| @@ -190,7 +189,7 @@ func (c *Controller) deletePod(obj interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %+v: %v", obj, err)) | |||
| return | |||
| @@ -222,13 +222,13 @@ func (c *Controller) updateFromEdge(name, namespace, operation string, content [ | |||
| err = c.updateStatusKnowledgeBase(name, namespace, condData) | |||
| if err != nil { | |||
| klog.Errorf("failed to update KnowledgeBase, err:%w", err) | |||
| klog.Errorf("failed to update KnowledgeBase, err: %v", err) | |||
| return err | |||
| } | |||
| err = c.appendStatusCondition(name, namespace, cond) | |||
| if err != nil { | |||
| klog.Errorf("failed to append condition, err:%w", err) | |||
| klog.Errorf("failed to append condition, err: %v", err) | |||
| return err | |||
| } | |||
| return nil | |||
| @@ -37,7 +37,6 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| @@ -264,7 +263,7 @@ func (c *Controller) updateDeployment(old, cur interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -37,13 +37,13 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| sednav1listers "github.com/kubeedge/sedna/pkg/client/listers/sedna/v1alpha1" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/config" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/runtime" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/utils" | |||
| ) | |||
| const ( | |||
| @@ -195,7 +195,7 @@ func (c *Controller) deletePod(obj interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -276,7 +276,7 @@ func (c *Controller) sync(key string) (bool, error) { | |||
| return false, err | |||
| } | |||
| activePods := k8scontroller.FilterActivePods(pods) | |||
| activePods := utils.FilterActivePods(pods) | |||
| active := int32(len(activePods)) | |||
| succeeded, failed := countPods(pods) | |||
| conditions := len(job.Status.Conditions) | |||
| @@ -37,13 +37,13 @@ import ( | |||
| "k8s.io/client-go/tools/record" | |||
| "k8s.io/client-go/util/workqueue" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| sednav1 "github.com/kubeedge/sedna/pkg/apis/sedna/v1alpha1" | |||
| sednaclientset "github.com/kubeedge/sedna/pkg/client/clientset/versioned/typed/sedna/v1alpha1" | |||
| sednav1listers "github.com/kubeedge/sedna/pkg/client/listers/sedna/v1alpha1" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/config" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/runtime" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/utils" | |||
| ) | |||
| const ( | |||
| @@ -195,7 +195,7 @@ func (c *Controller) deletePod(obj interface{}) { | |||
| // immediate tells the controller to update the status right away, and should | |||
| // happen ONLY when there was a successful pod run. | |||
| func (c *Controller) enqueueController(obj interface{}, immediate bool) { | |||
| key, err := k8scontroller.KeyFunc(obj) | |||
| key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(obj) | |||
| if err != nil { | |||
| klog.Warningf("Couldn't get key for object %+v: %v", obj, err) | |||
| return | |||
| @@ -276,7 +276,7 @@ func (c *Controller) sync(key string) (bool, error) { | |||
| return false, err | |||
| } | |||
| activePods := k8scontroller.FilterActivePods(pods) | |||
| activePods := utils.FilterActivePods(pods) | |||
| active := int32(len(activePods)) | |||
| succeeded, failed := countPods(pods) | |||
| conditions := len(job.Status.Conditions) | |||
| @@ -14,7 +14,8 @@ import ( | |||
| "k8s.io/apimachinery/pkg/util/intstr" | |||
| "k8s.io/client-go/kubernetes" | |||
| "k8s.io/klog/v2" | |||
| k8scontroller "k8s.io/kubernetes/pkg/controller" | |||
| "github.com/kubeedge/sedna/pkg/globalmanager/utils" | |||
| ) | |||
| type WorkerMount struct { | |||
| @@ -174,7 +175,7 @@ func injectWorkerParam(pod *v1.Pod, workerParam *WorkerParam, object CommonInter | |||
| // CreatePodWithTemplate creates and returns a pod object given a crd object, pod template, and workerParam | |||
| func CreatePodWithTemplate(client kubernetes.Interface, object CommonInterface, spec *v1.PodTemplateSpec, workerParam *WorkerParam) (*v1.Pod, error) { | |||
| objectKind := object.GroupVersionKind() | |||
| pod, _ := k8scontroller.GetPodFromTemplate(spec, object, metav1.NewControllerRef(object, objectKind)) | |||
| pod, _ := utils.GetPodFromTemplate(spec, object, metav1.NewControllerRef(object, objectKind)) | |||
| injectWorkerParam(pod, workerParam, object) | |||
| createdPod, err := client.CoreV1().Pods(object.GetNamespace()).Create(context.TODO(), pod, metav1.CreateOptions{}) | |||
| @@ -0,0 +1,105 @@ | |||
| /* | |||
| Copyright 2025 The KubeEdge Authors. | |||
| Licensed under the Apache License, Version 2.0 (the "License"); | |||
| you may not use this file except in compliance with the License. | |||
| You may obtain a copy of the License at | |||
| http://www.apache.org/licenses/LICENSE-2.0 | |||
| Unless required by applicable law or agreed to in writing, software | |||
| distributed under the License is distributed on an "AS IS" BASIS, | |||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| See the License for the specific language governing permissions and | |||
| limitations under the License. | |||
| */ | |||
| package utils | |||
| import ( | |||
| "fmt" | |||
| v1 "k8s.io/api/core/v1" | |||
| "k8s.io/apimachinery/pkg/api/meta" | |||
| apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" | |||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
| "k8s.io/apimachinery/pkg/labels" | |||
| "k8s.io/apimachinery/pkg/runtime" | |||
| "k8s.io/klog/v2" | |||
| ) | |||
| // FilterActivePods returns pods that have not terminated. | |||
| func FilterActivePods(pods []*v1.Pod) []*v1.Pod { | |||
| var result []*v1.Pod | |||
| for _, p := range pods { | |||
| if IsPodActive(p) { | |||
| result = append(result, p) | |||
| } else { | |||
| klog.V(4).Infof("Ignoring inactive pod %v/%v in state %v, deletion time %v", | |||
| p.Namespace, p.Name, p.Status.Phase, p.DeletionTimestamp) | |||
| } | |||
| } | |||
| return result | |||
| } | |||
| func IsPodActive(p *v1.Pod) bool { | |||
| return v1.PodSucceeded != p.Status.Phase && | |||
| v1.PodFailed != p.Status.Phase && | |||
| p.DeletionTimestamp == nil | |||
| } | |||
| func getPodsLabelSet(template *v1.PodTemplateSpec) labels.Set { | |||
| desiredLabels := make(labels.Set) | |||
| for k, v := range template.Labels { | |||
| desiredLabels[k] = v | |||
| } | |||
| return desiredLabels | |||
| } | |||
| func getPodsFinalizers(template *v1.PodTemplateSpec) []string { | |||
| desiredFinalizers := make([]string, len(template.Finalizers)) | |||
| copy(desiredFinalizers, template.Finalizers) | |||
| return desiredFinalizers | |||
| } | |||
| func getPodsAnnotationSet(template *v1.PodTemplateSpec) labels.Set { | |||
| desiredAnnotations := make(labels.Set) | |||
| for k, v := range template.Annotations { | |||
| desiredAnnotations[k] = v | |||
| } | |||
| return desiredAnnotations | |||
| } | |||
| func getPodsPrefix(controllerName string) string { | |||
| // use the dash (if the name isn't too long) to make the pod name a bit prettier | |||
| prefix := fmt.Sprintf("%s-", controllerName) | |||
| if len(apimachineryvalidation.NameIsDNSSubdomain(prefix, true)) != 0 { | |||
| prefix = controllerName | |||
| } | |||
| return prefix | |||
| } | |||
| func GetPodFromTemplate(template *v1.PodTemplateSpec, parentObject runtime.Object, controllerRef *metav1.OwnerReference) (*v1.Pod, error) { | |||
| desiredLabels := getPodsLabelSet(template) | |||
| desiredFinalizers := getPodsFinalizers(template) | |||
| desiredAnnotations := getPodsAnnotationSet(template) | |||
| accessor, err := meta.Accessor(parentObject) | |||
| if err != nil { | |||
| return nil, fmt.Errorf("parentObject does not have ObjectMeta, %v", err) | |||
| } | |||
| prefix := getPodsPrefix(accessor.GetName()) | |||
| pod := &v1.Pod{ | |||
| ObjectMeta: metav1.ObjectMeta{ | |||
| Labels: desiredLabels, | |||
| Annotations: desiredAnnotations, | |||
| GenerateName: prefix, | |||
| Finalizers: desiredFinalizers, | |||
| }, | |||
| } | |||
| if controllerRef != nil { | |||
| pod.OwnerReferences = append(pod.OwnerReferences, *controllerRef) | |||
| } | |||
| pod.Spec = *template.Spec.DeepCopy() | |||
| return pod, nil | |||
| } | |||
| @@ -431,7 +431,7 @@ func (im *Manager) startJob(name string) { | |||
| err = im.initJob(job, name) | |||
| if err != nil { | |||
| klog.Errorf("failed to init job (name=%s): %+v", name) | |||
| klog.Errorf("failed to init job (name=%s), err: %v", name, err) | |||
| return | |||
| } | |||
| @@ -757,7 +757,7 @@ func (im *Manager) getModelFromJobConditions(job *Job, jobStage sednav1.ILJobSta | |||
| getModel := func(initModel *Model, models []Model) *Model { | |||
| for _, m := range models { | |||
| if m.Format == initModel.Format { | |||
| if initModel.Devices != nil && len(m.Devices) == 1 { | |||
| if len(initModel.Devices) > 0 && len(m.Devices) == 1 { | |||
| for _, d := range initModel.Devices { | |||
| if m.Devices[0] == d { | |||
| return &m | |||
| @@ -108,7 +108,7 @@ func (s *Server) messageHandler(request *restful.Request, response *restful.Resp | |||
| msg = fmt.Sprintf("read worker(name=%s) message body failed, error: %v", workerName, err) | |||
| } | |||
| klog.Errorf(msg) | |||
| klog.Error(msg) | |||
| err = s.reply(response, http.StatusBadRequest, msg) | |||
| if err != nil { | |||
| klog.Errorf("reply messge to worker(name=%s) failed, error: %v", workerName, err) | |||
| @@ -185,7 +185,7 @@ func (f *Framework) AfterEach() { | |||
| for namespaceKey, namespaceErr := range nsDeletionErrors { | |||
| messages = append(messages, fmt.Sprintf("Couldn't delete ns: %q: %s (%#v)", namespaceKey, namespaceErr, namespaceErr)) | |||
| } | |||
| Failf(strings.Join(messages, ",")) | |||
| Fail(strings.Join(messages, ",")) | |||
| } | |||
| }() | |||
| @@ -68,10 +68,10 @@ var codeFilterRE = regexp.MustCompile(`/github.com/onsi/ginkgo/`) | |||
| // entries coming from Ginkgo. | |||
| // | |||
| // This is a modified copy of PruneStack in https://github.com/onsi/ginkgo/blob/f90f37d87fa6b1dd9625e2b1e83c23ffae3de228/internal/codelocation/code_location.go#L25: | |||
| // - simplified API and thus renamed (calls debug.Stack() instead of taking a parameter) | |||
| // - source code filtering updated to be specific to Kubernetes | |||
| // - optimized to use bytes and in-place slice filtering from | |||
| // https://github.com/golang/go/wiki/SliceTricks#filter-in-place | |||
| // - simplified API and thus renamed (calls debug.Stack() instead of taking a parameter) | |||
| // - source code filtering updated to be specific to Kubernetes | |||
| // - optimized to use bytes and in-place slice filtering from | |||
| // https://github.com/golang/go/wiki/SliceTricks#filter-in-place | |||
| func PrunedStack(skip int) []byte { | |||
| fullStackTrace := debug.Stack() | |||
| stack := bytes.Split(fullStackTrace, []byte("\n")) | |||
| @@ -10,6 +10,7 @@ import ( | |||
| "syscall" | |||
| "github.com/Azure/go-ansiterm" | |||
| windows "golang.org/x/sys/windows" | |||
| ) | |||
| // Windows keyboard constants | |||
| @@ -162,15 +163,28 @@ func ensureInRange(n int16, min int16, max int16) int16 { | |||
| func GetStdFile(nFile int) (*os.File, uintptr) { | |||
| var file *os.File | |||
| switch nFile { | |||
| case syscall.STD_INPUT_HANDLE: | |||
| // syscall uses negative numbers | |||
| // windows package uses very big uint32 | |||
| // Keep these switches split so we don't have to convert ints too much. | |||
| switch uint32(nFile) { | |||
| case windows.STD_INPUT_HANDLE: | |||
| file = os.Stdin | |||
| case syscall.STD_OUTPUT_HANDLE: | |||
| case windows.STD_OUTPUT_HANDLE: | |||
| file = os.Stdout | |||
| case syscall.STD_ERROR_HANDLE: | |||
| case windows.STD_ERROR_HANDLE: | |||
| file = os.Stderr | |||
| default: | |||
| panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) | |||
| switch nFile { | |||
| case syscall.STD_INPUT_HANDLE: | |||
| file = os.Stdin | |||
| case syscall.STD_OUTPUT_HANDLE: | |||
| file = os.Stdout | |||
| case syscall.STD_ERROR_HANDLE: | |||
| file = os.Stderr | |||
| default: | |||
| panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) | |||
| } | |||
| } | |||
| fd, err := syscall.GetStdHandle(nFile) | |||
| @@ -1,5 +0,0 @@ | |||
| *.sublime-* | |||
| .DS_Store | |||
| *.swp | |||
| *.swo | |||
| tags | |||
| @@ -1,12 +0,0 @@ | |||
| language: go | |||
| go: | |||
| - 1.4.x | |||
| - 1.5.x | |||
| - 1.6.x | |||
| - 1.7.x | |||
| - 1.8.x | |||
| - 1.9.x | |||
| - "1.10.x" | |||
| - "1.11.x" | |||
| - tip | |||
| @@ -1,12 +0,0 @@ | |||
| Copyright (c) 2012, Martin Angers | |||
| All rights reserved. | |||
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |||
| * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |||
| * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |||
| * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| @@ -1,188 +0,0 @@ | |||
| # Purell | |||
| Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know... | |||
| Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc]. | |||
| [](http://travis-ci.org/PuerkitoBio/purell) | |||
| ## Install | |||
| `go get github.com/PuerkitoBio/purell` | |||
| ## Changelog | |||
| * **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor). | |||
| * **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121). | |||
| * **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich). | |||
| * **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]). | |||
| * **v0.2.0** : Add benchmarks, Attempt IDN support. | |||
| * **v0.1.0** : Initial release. | |||
| ## Examples | |||
| From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."): | |||
| ```go | |||
| package purell | |||
| import ( | |||
| "fmt" | |||
| "net/url" | |||
| ) | |||
| func ExampleNormalizeURLString() { | |||
| if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/", | |||
| FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil { | |||
| panic(err) | |||
| } else { | |||
| fmt.Print(normalized) | |||
| } | |||
| // Output: http://somewebsite.com:80/Amazing%3F/url/ | |||
| } | |||
| func ExampleMustNormalizeURLString() { | |||
| normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/", | |||
| FlagsUnsafeGreedy) | |||
| fmt.Print(normalized) | |||
| // Output: http://somewebsite.com/Amazing%FA/url | |||
| } | |||
| func ExampleNormalizeURL() { | |||
| if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil { | |||
| panic(err) | |||
| } else { | |||
| normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment) | |||
| fmt.Print(normalized) | |||
| } | |||
| // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0 | |||
| } | |||
| ``` | |||
| ## API | |||
| As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags: | |||
| ```go | |||
| const ( | |||
| // Safe normalizations | |||
| FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 | |||
| FlagLowercaseHost // http://HOST -> http://host | |||
| FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF | |||
| FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA | |||
| FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ | |||
| FlagRemoveDefaultPort // http://host:80 -> http://host | |||
| FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path | |||
| // Usually safe normalizations | |||
| FlagRemoveTrailingSlash // http://host/path/ -> http://host/path | |||
| FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) | |||
| FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c | |||
| // Unsafe normalizations | |||
| FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ | |||
| FlagRemoveFragment // http://host/path#fragment -> http://host/path | |||
| FlagForceHTTP // https://host -> http://host | |||
| FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b | |||
| FlagRemoveWWW // http://www.host/ -> http://host/ | |||
| FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) | |||
| FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 | |||
| // Normalizations not in the wikipedia article, required to cover tests cases | |||
| // submitted by jehiah | |||
| FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 | |||
| FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 | |||
| FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 | |||
| FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path | |||
| FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path | |||
| // Convenience set of safe normalizations | |||
| FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator | |||
| // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, | |||
| // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". | |||
| // Convenience set of usually safe normalizations (includes FlagsSafe) | |||
| FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments | |||
| FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments | |||
| // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) | |||
| FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery | |||
| FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery | |||
| // Convenience set of all available flags | |||
| FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator | |||
| FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator | |||
| ) | |||
| ``` | |||
| For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set. | |||
| The [full godoc reference is available on gopkgdoc][godoc]. | |||
| Some things to note: | |||
| * `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it. | |||
| * The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*): | |||
| - %24 -> $ | |||
| - %26 -> & | |||
| - %2B-%3B -> +,-./0123456789:; | |||
| - %3D -> = | |||
| - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ | |||
| - %5F -> _ | |||
| - %61-%7A -> abcdefghijklmnopqrstuvwxyz | |||
| - %7E -> ~ | |||
| * When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization). | |||
| * The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell. | |||
| * The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object. | |||
| ### Safe vs Usually Safe vs Unsafe | |||
| Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between. | |||
| Consider the following URL: | |||
| `HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` | |||
| Normalizing with the `FlagsSafe` gives: | |||
| `https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid` | |||
| With the `FlagsUsuallySafeGreedy`: | |||
| `https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid` | |||
| And with `FlagsUnsafeGreedy`: | |||
| `http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3` | |||
| ## TODOs | |||
| * Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`. | |||
| ## Thanks / Contributions | |||
| @rogpeppe | |||
| @jehiah | |||
| @opennota | |||
| @pchristopher1275 | |||
| @zenovich | |||
| @beeker1121 | |||
| ## License | |||
| The [BSD 3-Clause license][bsd]. | |||
| [bsd]: http://opensource.org/licenses/BSD-3-Clause | |||
| [wiki]: http://en.wikipedia.org/wiki/URL_normalization | |||
| [rfc]: http://tools.ietf.org/html/rfc3986#section-6 | |||
| [godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell | |||
| [pr5]: https://github.com/PuerkitoBio/purell/pull/5 | |||
| [iss7]: https://github.com/PuerkitoBio/purell/issues/7 | |||
| @@ -1,379 +0,0 @@ | |||
| /* | |||
| Package purell offers URL normalization as described on the wikipedia page: | |||
| http://en.wikipedia.org/wiki/URL_normalization | |||
| */ | |||
| package purell | |||
| import ( | |||
| "bytes" | |||
| "fmt" | |||
| "net/url" | |||
| "regexp" | |||
| "sort" | |||
| "strconv" | |||
| "strings" | |||
| "github.com/PuerkitoBio/urlesc" | |||
| "golang.org/x/net/idna" | |||
| "golang.org/x/text/unicode/norm" | |||
| "golang.org/x/text/width" | |||
| ) | |||
| // A set of normalization flags determines how a URL will | |||
| // be normalized. | |||
| type NormalizationFlags uint | |||
| const ( | |||
| // Safe normalizations | |||
| FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1 | |||
| FlagLowercaseHost // http://HOST -> http://host | |||
| FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF | |||
| FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA | |||
| FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$ | |||
| FlagRemoveDefaultPort // http://host:80 -> http://host | |||
| FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path | |||
| // Usually safe normalizations | |||
| FlagRemoveTrailingSlash // http://host/path/ -> http://host/path | |||
| FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags) | |||
| FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c | |||
| // Unsafe normalizations | |||
| FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/ | |||
| FlagRemoveFragment // http://host/path#fragment -> http://host/path | |||
| FlagForceHTTP // https://host -> http://host | |||
| FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b | |||
| FlagRemoveWWW // http://www.host/ -> http://host/ | |||
| FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags) | |||
| FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3 | |||
| // Normalizations not in the wikipedia article, required to cover tests cases | |||
| // submitted by jehiah | |||
| FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147 | |||
| FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147 | |||
| FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147 | |||
| FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path | |||
| FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path | |||
| // Convenience set of safe normalizations | |||
| FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator | |||
| // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags, | |||
| // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix". | |||
| // Convenience set of usually safe normalizations (includes FlagsSafe) | |||
| FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments | |||
| FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments | |||
| // Convenience set of unsafe normalizations (includes FlagsUsuallySafe) | |||
| FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery | |||
| FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery | |||
| // Convenience set of all available flags | |||
| FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator | |||
| FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator | |||
| ) | |||
| const ( | |||
| defaultHttpPort = ":80" | |||
| defaultHttpsPort = ":443" | |||
| ) | |||
| // Regular expressions used by the normalizations | |||
| var rxPort = regexp.MustCompile(`(:\d+)/?$`) | |||
| var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`) | |||
| var rxDupSlashes = regexp.MustCompile(`/{2,}`) | |||
| var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`) | |||
| var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`) | |||
| var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`) | |||
| var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`) | |||
| var rxEmptyPort = regexp.MustCompile(`:+$`) | |||
| // Map of flags to implementation function. | |||
| // FlagDecodeUnnecessaryEscapes has no action, since it is done automatically | |||
| // by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator. | |||
| // Since maps have undefined traversing order, make a slice of ordered keys | |||
| var flagsOrder = []NormalizationFlags{ | |||
| FlagLowercaseScheme, | |||
| FlagLowercaseHost, | |||
| FlagRemoveDefaultPort, | |||
| FlagRemoveDirectoryIndex, | |||
| FlagRemoveDotSegments, | |||
| FlagRemoveFragment, | |||
| FlagForceHTTP, // Must be after remove default port (because https=443/http=80) | |||
| FlagRemoveDuplicateSlashes, | |||
| FlagRemoveWWW, | |||
| FlagAddWWW, | |||
| FlagSortQuery, | |||
| FlagDecodeDWORDHost, | |||
| FlagDecodeOctalHost, | |||
| FlagDecodeHexHost, | |||
| FlagRemoveUnnecessaryHostDots, | |||
| FlagRemoveEmptyPortSeparator, | |||
| FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last | |||
| FlagAddTrailingSlash, | |||
| } | |||
| // ... and then the map, where order is unimportant | |||
| var flags = map[NormalizationFlags]func(*url.URL){ | |||
| FlagLowercaseScheme: lowercaseScheme, | |||
| FlagLowercaseHost: lowercaseHost, | |||
| FlagRemoveDefaultPort: removeDefaultPort, | |||
| FlagRemoveDirectoryIndex: removeDirectoryIndex, | |||
| FlagRemoveDotSegments: removeDotSegments, | |||
| FlagRemoveFragment: removeFragment, | |||
| FlagForceHTTP: forceHTTP, | |||
| FlagRemoveDuplicateSlashes: removeDuplicateSlashes, | |||
| FlagRemoveWWW: removeWWW, | |||
| FlagAddWWW: addWWW, | |||
| FlagSortQuery: sortQuery, | |||
| FlagDecodeDWORDHost: decodeDWORDHost, | |||
| FlagDecodeOctalHost: decodeOctalHost, | |||
| FlagDecodeHexHost: decodeHexHost, | |||
| FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots, | |||
| FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator, | |||
| FlagRemoveTrailingSlash: removeTrailingSlash, | |||
| FlagAddTrailingSlash: addTrailingSlash, | |||
| } | |||
| // MustNormalizeURLString returns the normalized string, and panics if an error occurs. | |||
| // It takes an URL string as input, as well as the normalization flags. | |||
| func MustNormalizeURLString(u string, f NormalizationFlags) string { | |||
| result, e := NormalizeURLString(u, f) | |||
| if e != nil { | |||
| panic(e) | |||
| } | |||
| return result | |||
| } | |||
| // NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object. | |||
| // It takes an URL string as input, as well as the normalization flags. | |||
| func NormalizeURLString(u string, f NormalizationFlags) (string, error) { | |||
| parsed, err := url.Parse(u) | |||
| if err != nil { | |||
| return "", err | |||
| } | |||
| if f&FlagLowercaseHost == FlagLowercaseHost { | |||
| parsed.Host = strings.ToLower(parsed.Host) | |||
| } | |||
| // The idna package doesn't fully conform to RFC 5895 | |||
| // (https://tools.ietf.org/html/rfc5895), so we do it here. | |||
| // Taken from Go 1.8 cycle source, courtesy of bradfitz. | |||
| // TODO: Remove when (if?) idna package conforms to RFC 5895. | |||
| parsed.Host = width.Fold.String(parsed.Host) | |||
| parsed.Host = norm.NFC.String(parsed.Host) | |||
| if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { | |||
| return "", err | |||
| } | |||
| return NormalizeURL(parsed, f), nil | |||
| } | |||
| // NormalizeURL returns the normalized string. | |||
| // It takes a parsed URL object as input, as well as the normalization flags. | |||
| func NormalizeURL(u *url.URL, f NormalizationFlags) string { | |||
| for _, k := range flagsOrder { | |||
| if f&k == k { | |||
| flags[k](u) | |||
| } | |||
| } | |||
| return urlesc.Escape(u) | |||
| } | |||
| func lowercaseScheme(u *url.URL) { | |||
| if len(u.Scheme) > 0 { | |||
| u.Scheme = strings.ToLower(u.Scheme) | |||
| } | |||
| } | |||
| func lowercaseHost(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| u.Host = strings.ToLower(u.Host) | |||
| } | |||
| } | |||
| func removeDefaultPort(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| scheme := strings.ToLower(u.Scheme) | |||
| u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { | |||
| if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) { | |||
| return "" | |||
| } | |||
| return val | |||
| }) | |||
| } | |||
| } | |||
| func removeTrailingSlash(u *url.URL) { | |||
| if l := len(u.Path); l > 0 { | |||
| if strings.HasSuffix(u.Path, "/") { | |||
| u.Path = u.Path[:l-1] | |||
| } | |||
| } else if l = len(u.Host); l > 0 { | |||
| if strings.HasSuffix(u.Host, "/") { | |||
| u.Host = u.Host[:l-1] | |||
| } | |||
| } | |||
| } | |||
| func addTrailingSlash(u *url.URL) { | |||
| if l := len(u.Path); l > 0 { | |||
| if !strings.HasSuffix(u.Path, "/") { | |||
| u.Path += "/" | |||
| } | |||
| } else if l = len(u.Host); l > 0 { | |||
| if !strings.HasSuffix(u.Host, "/") { | |||
| u.Host += "/" | |||
| } | |||
| } | |||
| } | |||
| func removeDotSegments(u *url.URL) { | |||
| if len(u.Path) > 0 { | |||
| var dotFree []string | |||
| var lastIsDot bool | |||
| sections := strings.Split(u.Path, "/") | |||
| for _, s := range sections { | |||
| if s == ".." { | |||
| if len(dotFree) > 0 { | |||
| dotFree = dotFree[:len(dotFree)-1] | |||
| } | |||
| } else if s != "." { | |||
| dotFree = append(dotFree, s) | |||
| } | |||
| lastIsDot = (s == "." || s == "..") | |||
| } | |||
| // Special case if host does not end with / and new path does not begin with / | |||
| u.Path = strings.Join(dotFree, "/") | |||
| if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") { | |||
| u.Path = "/" + u.Path | |||
| } | |||
| // Special case if the last segment was a dot, make sure the path ends with a slash | |||
| if lastIsDot && !strings.HasSuffix(u.Path, "/") { | |||
| u.Path += "/" | |||
| } | |||
| } | |||
| } | |||
| func removeDirectoryIndex(u *url.URL) { | |||
| if len(u.Path) > 0 { | |||
| u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1") | |||
| } | |||
| } | |||
| func removeFragment(u *url.URL) { | |||
| u.Fragment = "" | |||
| } | |||
| func forceHTTP(u *url.URL) { | |||
| if strings.ToLower(u.Scheme) == "https" { | |||
| u.Scheme = "http" | |||
| } | |||
| } | |||
| func removeDuplicateSlashes(u *url.URL) { | |||
| if len(u.Path) > 0 { | |||
| u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") | |||
| } | |||
| } | |||
| func removeWWW(u *url.URL) { | |||
| if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") { | |||
| u.Host = u.Host[4:] | |||
| } | |||
| } | |||
| func addWWW(u *url.URL) { | |||
| if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") { | |||
| u.Host = "www." + u.Host | |||
| } | |||
| } | |||
| func sortQuery(u *url.URL) { | |||
| q := u.Query() | |||
| if len(q) > 0 { | |||
| arKeys := make([]string, len(q)) | |||
| i := 0 | |||
| for k := range q { | |||
| arKeys[i] = k | |||
| i++ | |||
| } | |||
| sort.Strings(arKeys) | |||
| buf := new(bytes.Buffer) | |||
| for _, k := range arKeys { | |||
| sort.Strings(q[k]) | |||
| for _, v := range q[k] { | |||
| if buf.Len() > 0 { | |||
| buf.WriteRune('&') | |||
| } | |||
| buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v))) | |||
| } | |||
| } | |||
| // Rebuild the raw query string | |||
| u.RawQuery = buf.String() | |||
| } | |||
| } | |||
| func decodeDWORDHost(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 { | |||
| var parts [4]int64 | |||
| dword, _ := strconv.ParseInt(matches[1], 10, 0) | |||
| for i, shift := range []uint{24, 16, 8, 0} { | |||
| parts[i] = dword >> shift & 0xFF | |||
| } | |||
| u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2]) | |||
| } | |||
| } | |||
| } | |||
| func decodeOctalHost(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 { | |||
| var parts [4]int64 | |||
| for i := 1; i <= 4; i++ { | |||
| parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0) | |||
| } | |||
| u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5]) | |||
| } | |||
| } | |||
| } | |||
| func decodeHexHost(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 { | |||
| // Conversion is safe because of regex validation | |||
| parsed, _ := strconv.ParseInt(matches[1], 16, 0) | |||
| // Set host as DWORD (base 10) encoded host | |||
| u.Host = fmt.Sprintf("%d%s", parsed, matches[2]) | |||
| // The rest is the same as decoding a DWORD host | |||
| decodeDWORDHost(u) | |||
| } | |||
| } | |||
| } | |||
| func removeUnncessaryHostDots(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 { | |||
| // Trim the leading and trailing dots | |||
| u.Host = strings.Trim(matches[1], ".") | |||
| if len(matches) > 2 { | |||
| u.Host += matches[2] | |||
| } | |||
| } | |||
| } | |||
| } | |||
| func removeEmptyPortSeparator(u *url.URL) { | |||
| if len(u.Host) > 0 { | |||
| u.Host = rxEmptyPort.ReplaceAllString(u.Host, "") | |||
| } | |||
| } | |||
| @@ -1,15 +0,0 @@ | |||
| language: go | |||
| go: | |||
| - 1.4.x | |||
| - 1.5.x | |||
| - 1.6.x | |||
| - 1.7.x | |||
| - 1.8.x | |||
| - tip | |||
| install: | |||
| - go build . | |||
| script: | |||
| - go test -v | |||
| @@ -1,16 +0,0 @@ | |||
| urlesc [](https://travis-ci.org/PuerkitoBio/urlesc) [](http://godoc.org/github.com/PuerkitoBio/urlesc) | |||
| ====== | |||
| Package urlesc implements query escaping as per RFC 3986. | |||
| It contains some parts of the net/url package, modified so as to allow | |||
| some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)). | |||
| ## Install | |||
| go get github.com/PuerkitoBio/urlesc | |||
| ## License | |||
| Go license (BSD-3-Clause) | |||
| @@ -1,180 +0,0 @@ | |||
| // Copyright 2009 The Go Authors. All rights reserved. | |||
| // Use of this source code is governed by a BSD-style | |||
| // license that can be found in the LICENSE file. | |||
| // Package urlesc implements query escaping as per RFC 3986. | |||
| // It contains some parts of the net/url package, modified so as to allow | |||
| // some reserved characters incorrectly escaped by net/url. | |||
| // See https://github.com/golang/go/issues/5684 | |||
| package urlesc | |||
| import ( | |||
| "bytes" | |||
| "net/url" | |||
| "strings" | |||
| ) | |||
| type encoding int | |||
| const ( | |||
| encodePath encoding = 1 + iota | |||
| encodeUserPassword | |||
| encodeQueryComponent | |||
| encodeFragment | |||
| ) | |||
| // Return true if the specified character should be escaped when | |||
| // appearing in a URL string, according to RFC 3986. | |||
| func shouldEscape(c byte, mode encoding) bool { | |||
| // §2.3 Unreserved characters (alphanum) | |||
| if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { | |||
| return false | |||
| } | |||
| switch c { | |||
| case '-', '.', '_', '~': // §2.3 Unreserved characters (mark) | |||
| return false | |||
| // §2.2 Reserved characters (reserved) | |||
| case ':', '/', '?', '#', '[', ']', '@', // gen-delims | |||
| '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims | |||
| // Different sections of the URL allow a few of | |||
| // the reserved characters to appear unescaped. | |||
| switch mode { | |||
| case encodePath: // §3.3 | |||
| // The RFC allows sub-delims and : @. | |||
| // '/', '[' and ']' can be used to assign meaning to individual path | |||
| // segments. This package only manipulates the path as a whole, | |||
| // so we allow those as well. That leaves only ? and # to escape. | |||
| return c == '?' || c == '#' | |||
| case encodeUserPassword: // §3.2.1 | |||
| // The RFC allows : and sub-delims in | |||
| // userinfo. The parsing of userinfo treats ':' as special so we must escape | |||
| // all the gen-delims. | |||
| return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@' | |||
| case encodeQueryComponent: // §3.4 | |||
| // The RFC allows / and ?. | |||
| return c != '/' && c != '?' | |||
| case encodeFragment: // §4.1 | |||
| // The RFC text is silent but the grammar allows | |||
| // everything, so escape nothing but # | |||
| return c == '#' | |||
| } | |||
| } | |||
| // Everything else must be escaped. | |||
| return true | |||
| } | |||
| // QueryEscape escapes the string so it can be safely placed | |||
| // inside a URL query. | |||
| func QueryEscape(s string) string { | |||
| return escape(s, encodeQueryComponent) | |||
| } | |||
| func escape(s string, mode encoding) string { | |||
| spaceCount, hexCount := 0, 0 | |||
| for i := 0; i < len(s); i++ { | |||
| c := s[i] | |||
| if shouldEscape(c, mode) { | |||
| if c == ' ' && mode == encodeQueryComponent { | |||
| spaceCount++ | |||
| } else { | |||
| hexCount++ | |||
| } | |||
| } | |||
| } | |||
| if spaceCount == 0 && hexCount == 0 { | |||
| return s | |||
| } | |||
| t := make([]byte, len(s)+2*hexCount) | |||
| j := 0 | |||
| for i := 0; i < len(s); i++ { | |||
| switch c := s[i]; { | |||
| case c == ' ' && mode == encodeQueryComponent: | |||
| t[j] = '+' | |||
| j++ | |||
| case shouldEscape(c, mode): | |||
| t[j] = '%' | |||
| t[j+1] = "0123456789ABCDEF"[c>>4] | |||
| t[j+2] = "0123456789ABCDEF"[c&15] | |||
| j += 3 | |||
| default: | |||
| t[j] = s[i] | |||
| j++ | |||
| } | |||
| } | |||
| return string(t) | |||
| } | |||
| var uiReplacer = strings.NewReplacer( | |||
| "%21", "!", | |||
| "%27", "'", | |||
| "%28", "(", | |||
| "%29", ")", | |||
| "%2A", "*", | |||
| ) | |||
| // unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986. | |||
| func unescapeUserinfo(s string) string { | |||
| return uiReplacer.Replace(s) | |||
| } | |||
| // Escape reassembles the URL into a valid URL string. | |||
| // The general form of the result is one of: | |||
| // | |||
| // scheme:opaque | |||
| // scheme://userinfo@host/path?query#fragment | |||
| // | |||
| // If u.Opaque is non-empty, String uses the first form; | |||
| // otherwise it uses the second form. | |||
| // | |||
| // In the second form, the following rules apply: | |||
| // - if u.Scheme is empty, scheme: is omitted. | |||
| // - if u.User is nil, userinfo@ is omitted. | |||
| // - if u.Host is empty, host/ is omitted. | |||
| // - if u.Scheme and u.Host are empty and u.User is nil, | |||
| // the entire scheme://userinfo@host/ is omitted. | |||
| // - if u.Host is non-empty and u.Path begins with a /, | |||
| // the form host/path does not add its own /. | |||
| // - if u.RawQuery is empty, ?query is omitted. | |||
| // - if u.Fragment is empty, #fragment is omitted. | |||
| func Escape(u *url.URL) string { | |||
| var buf bytes.Buffer | |||
| if u.Scheme != "" { | |||
| buf.WriteString(u.Scheme) | |||
| buf.WriteByte(':') | |||
| } | |||
| if u.Opaque != "" { | |||
| buf.WriteString(u.Opaque) | |||
| } else { | |||
| if u.Scheme != "" || u.Host != "" || u.User != nil { | |||
| buf.WriteString("//") | |||
| if ui := u.User; ui != nil { | |||
| buf.WriteString(unescapeUserinfo(ui.String())) | |||
| buf.WriteByte('@') | |||
| } | |||
| if h := u.Host; h != "" { | |||
| buf.WriteString(h) | |||
| } | |||
| } | |||
| if u.Path != "" && u.Path[0] != '/' && u.Host != "" { | |||
| buf.WriteByte('/') | |||
| } | |||
| buf.WriteString(escape(u.Path, encodePath)) | |||
| } | |||
| if u.RawQuery != "" { | |||
| buf.WriteByte('?') | |||
| buf.WriteString(u.RawQuery) | |||
| } | |||
| if u.Fragment != "" { | |||
| buf.WriteByte('#') | |||
| buf.WriteString(escape(u.Fragment, encodeFragment)) | |||
| } | |||
| return buf.String() | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| Copyright (C) 2013 Blake Mizerany | |||
| Permission is hereby granted, free of charge, to any person obtaining | |||
| a copy of this software and associated documentation files (the | |||
| "Software"), to deal in the Software without restriction, including | |||
| without limitation the rights to use, copy, modify, merge, publish, | |||
| distribute, sublicense, and/or sell copies of the Software, and to | |||
| permit persons to whom the Software is furnished to do so, subject to | |||
| the following conditions: | |||
| The above copyright notice and this permission notice shall be | |||
| included in all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| @@ -0,0 +1,316 @@ | |||
| // Package quantile computes approximate quantiles over an unbounded data | |||
| // stream within low memory and CPU bounds. | |||
| // | |||
| // A small amount of accuracy is traded to achieve the above properties. | |||
| // | |||
| // Multiple streams can be merged before calling Query to generate a single set | |||
| // of results. This is meaningful when the streams represent the same type of | |||
| // data. See Merge and Samples. | |||
| // | |||
| // For more detailed information about the algorithm used, see: | |||
| // | |||
| // Effective Computation of Biased Quantiles over Data Streams | |||
| // | |||
| // http://www.cs.rutgers.edu/~muthu/bquant.pdf | |||
| package quantile | |||
| import ( | |||
| "math" | |||
| "sort" | |||
| ) | |||
| // Sample holds an observed value and meta information for compression. JSON | |||
| // tags have been added for convenience. | |||
| type Sample struct { | |||
| Value float64 `json:",string"` | |||
| Width float64 `json:",string"` | |||
| Delta float64 `json:",string"` | |||
| } | |||
| // Samples represents a slice of samples. It implements sort.Interface. | |||
| type Samples []Sample | |||
| func (a Samples) Len() int { return len(a) } | |||
| func (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value } | |||
| func (a Samples) Swap(i, j int) { a[i], a[j] = a[j], a[i] } | |||
| type invariant func(s *stream, r float64) float64 | |||
| // NewLowBiased returns an initialized Stream for low-biased quantiles | |||
| // (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but | |||
| // error guarantees can still be given even for the lower ranks of the data | |||
| // distribution. | |||
| // | |||
| // The provided epsilon is a relative error, i.e. the true quantile of a value | |||
| // returned by a query is guaranteed to be within (1±Epsilon)*Quantile. | |||
| // | |||
| // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error | |||
| // properties. | |||
| func NewLowBiased(epsilon float64) *Stream { | |||
| ƒ := func(s *stream, r float64) float64 { | |||
| return 2 * epsilon * r | |||
| } | |||
| return newStream(ƒ) | |||
| } | |||
| // NewHighBiased returns an initialized Stream for high-biased quantiles | |||
| // (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but | |||
| // error guarantees can still be given even for the higher ranks of the data | |||
| // distribution. | |||
| // | |||
| // The provided epsilon is a relative error, i.e. the true quantile of a value | |||
| // returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile). | |||
| // | |||
| // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error | |||
| // properties. | |||
| func NewHighBiased(epsilon float64) *Stream { | |||
| ƒ := func(s *stream, r float64) float64 { | |||
| return 2 * epsilon * (s.n - r) | |||
| } | |||
| return newStream(ƒ) | |||
| } | |||
| // NewTargeted returns an initialized Stream concerned with a particular set of | |||
| // quantile values that are supplied a priori. Knowing these a priori reduces | |||
| // space and computation time. The targets map maps the desired quantiles to | |||
| // their absolute errors, i.e. the true quantile of a value returned by a query | |||
| // is guaranteed to be within (Quantile±Epsilon). | |||
| // | |||
| // See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties. | |||
| func NewTargeted(targetMap map[float64]float64) *Stream { | |||
| // Convert map to slice to avoid slow iterations on a map. | |||
| // ƒ is called on the hot path, so converting the map to a slice | |||
| // beforehand results in significant CPU savings. | |||
| targets := targetMapToSlice(targetMap) | |||
| ƒ := func(s *stream, r float64) float64 { | |||
| var m = math.MaxFloat64 | |||
| var f float64 | |||
| for _, t := range targets { | |||
| if t.quantile*s.n <= r { | |||
| f = (2 * t.epsilon * r) / t.quantile | |||
| } else { | |||
| f = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile) | |||
| } | |||
| if f < m { | |||
| m = f | |||
| } | |||
| } | |||
| return m | |||
| } | |||
| return newStream(ƒ) | |||
| } | |||
| type target struct { | |||
| quantile float64 | |||
| epsilon float64 | |||
| } | |||
| func targetMapToSlice(targetMap map[float64]float64) []target { | |||
| targets := make([]target, 0, len(targetMap)) | |||
| for quantile, epsilon := range targetMap { | |||
| t := target{ | |||
| quantile: quantile, | |||
| epsilon: epsilon, | |||
| } | |||
| targets = append(targets, t) | |||
| } | |||
| return targets | |||
| } | |||
| // Stream computes quantiles for a stream of float64s. It is not thread-safe by | |||
| // design. Take care when using across multiple goroutines. | |||
| type Stream struct { | |||
| *stream | |||
| b Samples | |||
| sorted bool | |||
| } | |||
| func newStream(ƒ invariant) *Stream { | |||
| x := &stream{ƒ: ƒ} | |||
| return &Stream{x, make(Samples, 0, 500), true} | |||
| } | |||
| // Insert inserts v into the stream. | |||
| func (s *Stream) Insert(v float64) { | |||
| s.insert(Sample{Value: v, Width: 1}) | |||
| } | |||
| func (s *Stream) insert(sample Sample) { | |||
| s.b = append(s.b, sample) | |||
| s.sorted = false | |||
| if len(s.b) == cap(s.b) { | |||
| s.flush() | |||
| } | |||
| } | |||
| // Query returns the computed qth percentiles value. If s was created with | |||
| // NewTargeted, and q is not in the set of quantiles provided a priori, Query | |||
| // will return an unspecified result. | |||
| func (s *Stream) Query(q float64) float64 { | |||
| if !s.flushed() { | |||
| // Fast path when there hasn't been enough data for a flush; | |||
| // this also yields better accuracy for small sets of data. | |||
| l := len(s.b) | |||
| if l == 0 { | |||
| return 0 | |||
| } | |||
| i := int(math.Ceil(float64(l) * q)) | |||
| if i > 0 { | |||
| i -= 1 | |||
| } | |||
| s.maybeSort() | |||
| return s.b[i].Value | |||
| } | |||
| s.flush() | |||
| return s.stream.query(q) | |||
| } | |||
| // Merge merges samples into the underlying streams samples. This is handy when | |||
| // merging multiple streams from separate threads, database shards, etc. | |||
| // | |||
| // ATTENTION: This method is broken and does not yield correct results. The | |||
| // underlying algorithm is not capable of merging streams correctly. | |||
| func (s *Stream) Merge(samples Samples) { | |||
| sort.Sort(samples) | |||
| s.stream.merge(samples) | |||
| } | |||
| // Reset reinitializes and clears the list reusing the samples buffer memory. | |||
| func (s *Stream) Reset() { | |||
| s.stream.reset() | |||
| s.b = s.b[:0] | |||
| } | |||
| // Samples returns stream samples held by s. | |||
| func (s *Stream) Samples() Samples { | |||
| if !s.flushed() { | |||
| return s.b | |||
| } | |||
| s.flush() | |||
| return s.stream.samples() | |||
| } | |||
| // Count returns the total number of samples observed in the stream | |||
| // since initialization. | |||
| func (s *Stream) Count() int { | |||
| return len(s.b) + s.stream.count() | |||
| } | |||
| func (s *Stream) flush() { | |||
| s.maybeSort() | |||
| s.stream.merge(s.b) | |||
| s.b = s.b[:0] | |||
| } | |||
| func (s *Stream) maybeSort() { | |||
| if !s.sorted { | |||
| s.sorted = true | |||
| sort.Sort(s.b) | |||
| } | |||
| } | |||
| func (s *Stream) flushed() bool { | |||
| return len(s.stream.l) > 0 | |||
| } | |||
| type stream struct { | |||
| n float64 | |||
| l []Sample | |||
| ƒ invariant | |||
| } | |||
| func (s *stream) reset() { | |||
| s.l = s.l[:0] | |||
| s.n = 0 | |||
| } | |||
| func (s *stream) insert(v float64) { | |||
| s.merge(Samples{{v, 1, 0}}) | |||
| } | |||
| func (s *stream) merge(samples Samples) { | |||
| // TODO(beorn7): This tries to merge not only individual samples, but | |||
| // whole summaries. The paper doesn't mention merging summaries at | |||
| // all. Unittests show that the merging is inaccurate. Find out how to | |||
| // do merges properly. | |||
| var r float64 | |||
| i := 0 | |||
| for _, sample := range samples { | |||
| for ; i < len(s.l); i++ { | |||
| c := s.l[i] | |||
| if c.Value > sample.Value { | |||
| // Insert at position i. | |||
| s.l = append(s.l, Sample{}) | |||
| copy(s.l[i+1:], s.l[i:]) | |||
| s.l[i] = Sample{ | |||
| sample.Value, | |||
| sample.Width, | |||
| math.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1), | |||
| // TODO(beorn7): How to calculate delta correctly? | |||
| } | |||
| i++ | |||
| goto inserted | |||
| } | |||
| r += c.Width | |||
| } | |||
| s.l = append(s.l, Sample{sample.Value, sample.Width, 0}) | |||
| i++ | |||
| inserted: | |||
| s.n += sample.Width | |||
| r += sample.Width | |||
| } | |||
| s.compress() | |||
| } | |||
| func (s *stream) count() int { | |||
| return int(s.n) | |||
| } | |||
| func (s *stream) query(q float64) float64 { | |||
| t := math.Ceil(q * s.n) | |||
| t += math.Ceil(s.ƒ(s, t) / 2) | |||
| p := s.l[0] | |||
| var r float64 | |||
| for _, c := range s.l[1:] { | |||
| r += p.Width | |||
| if r+c.Width+c.Delta > t { | |||
| return p.Value | |||
| } | |||
| p = c | |||
| } | |||
| return p.Value | |||
| } | |||
| func (s *stream) compress() { | |||
| if len(s.l) < 2 { | |||
| return | |||
| } | |||
| x := s.l[len(s.l)-1] | |||
| xi := len(s.l) - 1 | |||
| r := s.n - 1 - x.Width | |||
| for i := len(s.l) - 2; i >= 0; i-- { | |||
| c := s.l[i] | |||
| if c.Width+x.Width+x.Delta <= s.ƒ(s, r) { | |||
| x.Width += c.Width | |||
| s.l[xi] = x | |||
| // Remove element at i. | |||
| copy(s.l[i:], s.l[i+1:]) | |||
| s.l = s.l[:len(s.l)-1] | |||
| xi -= 1 | |||
| } else { | |||
| x = c | |||
| xi = i | |||
| } | |||
| r -= c.Width | |||
| } | |||
| } | |||
| func (s *stream) samples() Samples { | |||
| samples := make(Samples, len(s.l)) | |||
| copy(samples, s.l) | |||
| return samples | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| The MIT License | |||
| Copyright (c) 2014 Benedikt Lang <github at benediktlang.de> | |||
| Permission is hereby granted, free of charge, to any person obtaining a copy | |||
| of this software and associated documentation files (the "Software"), to deal | |||
| in the Software without restriction, including without limitation the rights | |||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
| copies of the Software, and to permit persons to whom the Software is | |||
| furnished to do so, subject to the following conditions: | |||
| The above copyright notice and this permission notice shall be included in | |||
| all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |||
| THE SOFTWARE. | |||
| @@ -0,0 +1,23 @@ | |||
| package semver | |||
| import ( | |||
| "encoding/json" | |||
| ) | |||
| // MarshalJSON implements the encoding/json.Marshaler interface. | |||
| func (v Version) MarshalJSON() ([]byte, error) { | |||
| return json.Marshal(v.String()) | |||
| } | |||
| // UnmarshalJSON implements the encoding/json.Unmarshaler interface. | |||
| func (v *Version) UnmarshalJSON(data []byte) (err error) { | |||
| var versionString string | |||
| if err = json.Unmarshal(data, &versionString); err != nil { | |||
| return | |||
| } | |||
| *v, err = Parse(versionString) | |||
| return | |||
| } | |||
| @@ -0,0 +1,416 @@ | |||
| package semver | |||
| import ( | |||
| "fmt" | |||
| "strconv" | |||
| "strings" | |||
| "unicode" | |||
| ) | |||
| type wildcardType int | |||
| const ( | |||
| noneWildcard wildcardType = iota | |||
| majorWildcard wildcardType = 1 | |||
| minorWildcard wildcardType = 2 | |||
| patchWildcard wildcardType = 3 | |||
| ) | |||
| func wildcardTypefromInt(i int) wildcardType { | |||
| switch i { | |||
| case 1: | |||
| return majorWildcard | |||
| case 2: | |||
| return minorWildcard | |||
| case 3: | |||
| return patchWildcard | |||
| default: | |||
| return noneWildcard | |||
| } | |||
| } | |||
| type comparator func(Version, Version) bool | |||
| var ( | |||
| compEQ comparator = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) == 0 | |||
| } | |||
| compNE = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) != 0 | |||
| } | |||
| compGT = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) == 1 | |||
| } | |||
| compGE = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) >= 0 | |||
| } | |||
| compLT = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) == -1 | |||
| } | |||
| compLE = func(v1 Version, v2 Version) bool { | |||
| return v1.Compare(v2) <= 0 | |||
| } | |||
| ) | |||
| type versionRange struct { | |||
| v Version | |||
| c comparator | |||
| } | |||
| // rangeFunc creates a Range from the given versionRange. | |||
| func (vr *versionRange) rangeFunc() Range { | |||
| return Range(func(v Version) bool { | |||
| return vr.c(v, vr.v) | |||
| }) | |||
| } | |||
| // Range represents a range of versions. | |||
| // A Range can be used to check if a Version satisfies it: | |||
| // | |||
| // range, err := semver.ParseRange(">1.0.0 <2.0.0") | |||
| // range(semver.MustParse("1.1.1") // returns true | |||
| type Range func(Version) bool | |||
| // OR combines the existing Range with another Range using logical OR. | |||
| func (rf Range) OR(f Range) Range { | |||
| return Range(func(v Version) bool { | |||
| return rf(v) || f(v) | |||
| }) | |||
| } | |||
| // AND combines the existing Range with another Range using logical AND. | |||
| func (rf Range) AND(f Range) Range { | |||
| return Range(func(v Version) bool { | |||
| return rf(v) && f(v) | |||
| }) | |||
| } | |||
| // ParseRange parses a range and returns a Range. | |||
| // If the range could not be parsed an error is returned. | |||
| // | |||
| // Valid ranges are: | |||
| // - "<1.0.0" | |||
| // - "<=1.0.0" | |||
| // - ">1.0.0" | |||
| // - ">=1.0.0" | |||
| // - "1.0.0", "=1.0.0", "==1.0.0" | |||
| // - "!1.0.0", "!=1.0.0" | |||
| // | |||
| // A Range can consist of multiple ranges separated by space: | |||
| // Ranges can be linked by logical AND: | |||
| // - ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0" | |||
| // - ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2 | |||
| // | |||
| // Ranges can also be linked by logical OR: | |||
| // - "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x" | |||
| // | |||
| // AND has a higher precedence than OR. It's not possible to use brackets. | |||
| // | |||
| // Ranges can be combined by both AND and OR | |||
| // | |||
| // - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1` | |||
| func ParseRange(s string) (Range, error) { | |||
| parts := splitAndTrim(s) | |||
| orParts, err := splitORParts(parts) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| expandedParts, err := expandWildcardVersion(orParts) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| var orFn Range | |||
| for _, p := range expandedParts { | |||
| var andFn Range | |||
| for _, ap := range p { | |||
| opStr, vStr, err := splitComparatorVersion(ap) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| vr, err := buildVersionRange(opStr, vStr) | |||
| if err != nil { | |||
| return nil, fmt.Errorf("Could not parse Range %q: %s", ap, err) | |||
| } | |||
| rf := vr.rangeFunc() | |||
| // Set function | |||
| if andFn == nil { | |||
| andFn = rf | |||
| } else { // Combine with existing function | |||
| andFn = andFn.AND(rf) | |||
| } | |||
| } | |||
| if orFn == nil { | |||
| orFn = andFn | |||
| } else { | |||
| orFn = orFn.OR(andFn) | |||
| } | |||
| } | |||
| return orFn, nil | |||
| } | |||
| // splitORParts splits the already cleaned parts by '||'. | |||
| // Checks for invalid positions of the operator and returns an | |||
| // error if found. | |||
| func splitORParts(parts []string) ([][]string, error) { | |||
| var ORparts [][]string | |||
| last := 0 | |||
| for i, p := range parts { | |||
| if p == "||" { | |||
| if i == 0 { | |||
| return nil, fmt.Errorf("First element in range is '||'") | |||
| } | |||
| ORparts = append(ORparts, parts[last:i]) | |||
| last = i + 1 | |||
| } | |||
| } | |||
| if last == len(parts) { | |||
| return nil, fmt.Errorf("Last element in range is '||'") | |||
| } | |||
| ORparts = append(ORparts, parts[last:]) | |||
| return ORparts, nil | |||
| } | |||
| // buildVersionRange takes a slice of 2: operator and version | |||
| // and builds a versionRange, otherwise an error. | |||
| func buildVersionRange(opStr, vStr string) (*versionRange, error) { | |||
| c := parseComparator(opStr) | |||
| if c == nil { | |||
| return nil, fmt.Errorf("Could not parse comparator %q in %q", opStr, strings.Join([]string{opStr, vStr}, "")) | |||
| } | |||
| v, err := Parse(vStr) | |||
| if err != nil { | |||
| return nil, fmt.Errorf("Could not parse version %q in %q: %s", vStr, strings.Join([]string{opStr, vStr}, ""), err) | |||
| } | |||
| return &versionRange{ | |||
| v: v, | |||
| c: c, | |||
| }, nil | |||
| } | |||
| // inArray checks if a byte is contained in an array of bytes | |||
| func inArray(s byte, list []byte) bool { | |||
| for _, el := range list { | |||
| if el == s { | |||
| return true | |||
| } | |||
| } | |||
| return false | |||
| } | |||
| // splitAndTrim splits a range string by spaces and cleans whitespaces | |||
| func splitAndTrim(s string) (result []string) { | |||
| last := 0 | |||
| var lastChar byte | |||
| excludeFromSplit := []byte{'>', '<', '='} | |||
| for i := 0; i < len(s); i++ { | |||
| if s[i] == ' ' && !inArray(lastChar, excludeFromSplit) { | |||
| if last < i-1 { | |||
| result = append(result, s[last:i]) | |||
| } | |||
| last = i + 1 | |||
| } else if s[i] != ' ' { | |||
| lastChar = s[i] | |||
| } | |||
| } | |||
| if last < len(s)-1 { | |||
| result = append(result, s[last:]) | |||
| } | |||
| for i, v := range result { | |||
| result[i] = strings.Replace(v, " ", "", -1) | |||
| } | |||
| // parts := strings.Split(s, " ") | |||
| // for _, x := range parts { | |||
| // if s := strings.TrimSpace(x); len(s) != 0 { | |||
| // result = append(result, s) | |||
| // } | |||
| // } | |||
| return | |||
| } | |||
| // splitComparatorVersion splits the comparator from the version. | |||
| // Input must be free of leading or trailing spaces. | |||
| func splitComparatorVersion(s string) (string, string, error) { | |||
| i := strings.IndexFunc(s, unicode.IsDigit) | |||
| if i == -1 { | |||
| return "", "", fmt.Errorf("Could not get version from string: %q", s) | |||
| } | |||
| return strings.TrimSpace(s[0:i]), s[i:], nil | |||
| } | |||
| // getWildcardType will return the type of wildcard that the | |||
| // passed version contains | |||
| func getWildcardType(vStr string) wildcardType { | |||
| parts := strings.Split(vStr, ".") | |||
| nparts := len(parts) | |||
| wildcard := parts[nparts-1] | |||
| possibleWildcardType := wildcardTypefromInt(nparts) | |||
| if wildcard == "x" { | |||
| return possibleWildcardType | |||
| } | |||
| return noneWildcard | |||
| } | |||
| // createVersionFromWildcard will convert a wildcard version | |||
| // into a regular version, replacing 'x's with '0's, handling | |||
| // special cases like '1.x.x' and '1.x' | |||
| func createVersionFromWildcard(vStr string) string { | |||
| // handle 1.x.x | |||
| vStr2 := strings.Replace(vStr, ".x.x", ".x", 1) | |||
| vStr2 = strings.Replace(vStr2, ".x", ".0", 1) | |||
| parts := strings.Split(vStr2, ".") | |||
| // handle 1.x | |||
| if len(parts) == 2 { | |||
| return vStr2 + ".0" | |||
| } | |||
| return vStr2 | |||
| } | |||
| // incrementMajorVersion will increment the major version | |||
| // of the passed version | |||
| func incrementMajorVersion(vStr string) (string, error) { | |||
| parts := strings.Split(vStr, ".") | |||
| i, err := strconv.Atoi(parts[0]) | |||
| if err != nil { | |||
| return "", err | |||
| } | |||
| parts[0] = strconv.Itoa(i + 1) | |||
| return strings.Join(parts, "."), nil | |||
| } | |||
| // incrementMajorVersion will increment the minor version | |||
| // of the passed version | |||
| func incrementMinorVersion(vStr string) (string, error) { | |||
| parts := strings.Split(vStr, ".") | |||
| i, err := strconv.Atoi(parts[1]) | |||
| if err != nil { | |||
| return "", err | |||
| } | |||
| parts[1] = strconv.Itoa(i + 1) | |||
| return strings.Join(parts, "."), nil | |||
| } | |||
| // expandWildcardVersion will expand wildcards inside versions | |||
| // following these rules: | |||
| // | |||
| // * when dealing with patch wildcards: | |||
| // >= 1.2.x will become >= 1.2.0 | |||
| // <= 1.2.x will become < 1.3.0 | |||
| // > 1.2.x will become >= 1.3.0 | |||
| // < 1.2.x will become < 1.2.0 | |||
| // != 1.2.x will become < 1.2.0 >= 1.3.0 | |||
| // | |||
| // * when dealing with minor wildcards: | |||
| // >= 1.x will become >= 1.0.0 | |||
| // <= 1.x will become < 2.0.0 | |||
| // > 1.x will become >= 2.0.0 | |||
| // < 1.0 will become < 1.0.0 | |||
| // != 1.x will become < 1.0.0 >= 2.0.0 | |||
| // | |||
| // * when dealing with wildcards without | |||
| // version operator: | |||
| // 1.2.x will become >= 1.2.0 < 1.3.0 | |||
| // 1.x will become >= 1.0.0 < 2.0.0 | |||
| func expandWildcardVersion(parts [][]string) ([][]string, error) { | |||
| var expandedParts [][]string | |||
| for _, p := range parts { | |||
| var newParts []string | |||
| for _, ap := range p { | |||
| if strings.Contains(ap, "x") { | |||
| opStr, vStr, err := splitComparatorVersion(ap) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| versionWildcardType := getWildcardType(vStr) | |||
| flatVersion := createVersionFromWildcard(vStr) | |||
| var resultOperator string | |||
| var shouldIncrementVersion bool | |||
| switch opStr { | |||
| case ">": | |||
| resultOperator = ">=" | |||
| shouldIncrementVersion = true | |||
| case ">=": | |||
| resultOperator = ">=" | |||
| case "<": | |||
| resultOperator = "<" | |||
| case "<=": | |||
| resultOperator = "<" | |||
| shouldIncrementVersion = true | |||
| case "", "=", "==": | |||
| newParts = append(newParts, ">="+flatVersion) | |||
| resultOperator = "<" | |||
| shouldIncrementVersion = true | |||
| case "!=", "!": | |||
| newParts = append(newParts, "<"+flatVersion) | |||
| resultOperator = ">=" | |||
| shouldIncrementVersion = true | |||
| } | |||
| var resultVersion string | |||
| if shouldIncrementVersion { | |||
| switch versionWildcardType { | |||
| case patchWildcard: | |||
| resultVersion, _ = incrementMinorVersion(flatVersion) | |||
| case minorWildcard: | |||
| resultVersion, _ = incrementMajorVersion(flatVersion) | |||
| } | |||
| } else { | |||
| resultVersion = flatVersion | |||
| } | |||
| ap = resultOperator + resultVersion | |||
| } | |||
| newParts = append(newParts, ap) | |||
| } | |||
| expandedParts = append(expandedParts, newParts) | |||
| } | |||
| return expandedParts, nil | |||
| } | |||
| func parseComparator(s string) comparator { | |||
| switch s { | |||
| case "==": | |||
| fallthrough | |||
| case "": | |||
| fallthrough | |||
| case "=": | |||
| return compEQ | |||
| case ">": | |||
| return compGT | |||
| case ">=": | |||
| return compGE | |||
| case "<": | |||
| return compLT | |||
| case "<=": | |||
| return compLE | |||
| case "!": | |||
| fallthrough | |||
| case "!=": | |||
| return compNE | |||
| } | |||
| return nil | |||
| } | |||
| // MustParseRange is like ParseRange but panics if the range cannot be parsed. | |||
| func MustParseRange(s string) Range { | |||
| r, err := ParseRange(s) | |||
| if err != nil { | |||
| panic(`semver: ParseRange(` + s + `): ` + err.Error()) | |||
| } | |||
| return r | |||
| } | |||
| @@ -0,0 +1,476 @@ | |||
| package semver | |||
| import ( | |||
| "errors" | |||
| "fmt" | |||
| "strconv" | |||
| "strings" | |||
| ) | |||
| const ( | |||
| numbers string = "0123456789" | |||
| alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" | |||
| alphanum = alphas + numbers | |||
| ) | |||
| // SpecVersion is the latest fully supported spec version of semver | |||
| var SpecVersion = Version{ | |||
| Major: 2, | |||
| Minor: 0, | |||
| Patch: 0, | |||
| } | |||
| // Version represents a semver compatible version | |||
| type Version struct { | |||
| Major uint64 | |||
| Minor uint64 | |||
| Patch uint64 | |||
| Pre []PRVersion | |||
| Build []string //No Precedence | |||
| } | |||
| // Version to string | |||
| func (v Version) String() string { | |||
| b := make([]byte, 0, 5) | |||
| b = strconv.AppendUint(b, v.Major, 10) | |||
| b = append(b, '.') | |||
| b = strconv.AppendUint(b, v.Minor, 10) | |||
| b = append(b, '.') | |||
| b = strconv.AppendUint(b, v.Patch, 10) | |||
| if len(v.Pre) > 0 { | |||
| b = append(b, '-') | |||
| b = append(b, v.Pre[0].String()...) | |||
| for _, pre := range v.Pre[1:] { | |||
| b = append(b, '.') | |||
| b = append(b, pre.String()...) | |||
| } | |||
| } | |||
| if len(v.Build) > 0 { | |||
| b = append(b, '+') | |||
| b = append(b, v.Build[0]...) | |||
| for _, build := range v.Build[1:] { | |||
| b = append(b, '.') | |||
| b = append(b, build...) | |||
| } | |||
| } | |||
| return string(b) | |||
| } | |||
| // FinalizeVersion discards prerelease and build number and only returns | |||
| // major, minor and patch number. | |||
| func (v Version) FinalizeVersion() string { | |||
| b := make([]byte, 0, 5) | |||
| b = strconv.AppendUint(b, v.Major, 10) | |||
| b = append(b, '.') | |||
| b = strconv.AppendUint(b, v.Minor, 10) | |||
| b = append(b, '.') | |||
| b = strconv.AppendUint(b, v.Patch, 10) | |||
| return string(b) | |||
| } | |||
| // Equals checks if v is equal to o. | |||
| func (v Version) Equals(o Version) bool { | |||
| return (v.Compare(o) == 0) | |||
| } | |||
| // EQ checks if v is equal to o. | |||
| func (v Version) EQ(o Version) bool { | |||
| return (v.Compare(o) == 0) | |||
| } | |||
| // NE checks if v is not equal to o. | |||
| func (v Version) NE(o Version) bool { | |||
| return (v.Compare(o) != 0) | |||
| } | |||
| // GT checks if v is greater than o. | |||
| func (v Version) GT(o Version) bool { | |||
| return (v.Compare(o) == 1) | |||
| } | |||
| // GTE checks if v is greater than or equal to o. | |||
| func (v Version) GTE(o Version) bool { | |||
| return (v.Compare(o) >= 0) | |||
| } | |||
| // GE checks if v is greater than or equal to o. | |||
| func (v Version) GE(o Version) bool { | |||
| return (v.Compare(o) >= 0) | |||
| } | |||
| // LT checks if v is less than o. | |||
| func (v Version) LT(o Version) bool { | |||
| return (v.Compare(o) == -1) | |||
| } | |||
| // LTE checks if v is less than or equal to o. | |||
| func (v Version) LTE(o Version) bool { | |||
| return (v.Compare(o) <= 0) | |||
| } | |||
| // LE checks if v is less than or equal to o. | |||
| func (v Version) LE(o Version) bool { | |||
| return (v.Compare(o) <= 0) | |||
| } | |||
| // Compare compares Versions v to o: | |||
| // -1 == v is less than o | |||
| // 0 == v is equal to o | |||
| // 1 == v is greater than o | |||
| func (v Version) Compare(o Version) int { | |||
| if v.Major != o.Major { | |||
| if v.Major > o.Major { | |||
| return 1 | |||
| } | |||
| return -1 | |||
| } | |||
| if v.Minor != o.Minor { | |||
| if v.Minor > o.Minor { | |||
| return 1 | |||
| } | |||
| return -1 | |||
| } | |||
| if v.Patch != o.Patch { | |||
| if v.Patch > o.Patch { | |||
| return 1 | |||
| } | |||
| return -1 | |||
| } | |||
| // Quick comparison if a version has no prerelease versions | |||
| if len(v.Pre) == 0 && len(o.Pre) == 0 { | |||
| return 0 | |||
| } else if len(v.Pre) == 0 && len(o.Pre) > 0 { | |||
| return 1 | |||
| } else if len(v.Pre) > 0 && len(o.Pre) == 0 { | |||
| return -1 | |||
| } | |||
| i := 0 | |||
| for ; i < len(v.Pre) && i < len(o.Pre); i++ { | |||
| if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 { | |||
| continue | |||
| } else if comp == 1 { | |||
| return 1 | |||
| } else { | |||
| return -1 | |||
| } | |||
| } | |||
| // If all pr versions are the equal but one has further prversion, this one greater | |||
| if i == len(v.Pre) && i == len(o.Pre) { | |||
| return 0 | |||
| } else if i == len(v.Pre) && i < len(o.Pre) { | |||
| return -1 | |||
| } else { | |||
| return 1 | |||
| } | |||
| } | |||
| // IncrementPatch increments the patch version | |||
| func (v *Version) IncrementPatch() error { | |||
| v.Patch++ | |||
| return nil | |||
| } | |||
| // IncrementMinor increments the minor version | |||
| func (v *Version) IncrementMinor() error { | |||
| v.Minor++ | |||
| v.Patch = 0 | |||
| return nil | |||
| } | |||
| // IncrementMajor increments the major version | |||
| func (v *Version) IncrementMajor() error { | |||
| v.Major++ | |||
| v.Minor = 0 | |||
| v.Patch = 0 | |||
| return nil | |||
| } | |||
| // Validate validates v and returns error in case | |||
| func (v Version) Validate() error { | |||
| // Major, Minor, Patch already validated using uint64 | |||
| for _, pre := range v.Pre { | |||
| if !pre.IsNum { //Numeric prerelease versions already uint64 | |||
| if len(pre.VersionStr) == 0 { | |||
| return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr) | |||
| } | |||
| if !containsOnly(pre.VersionStr, alphanum) { | |||
| return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr) | |||
| } | |||
| } | |||
| } | |||
| for _, build := range v.Build { | |||
| if len(build) == 0 { | |||
| return fmt.Errorf("Build meta data can not be empty %q", build) | |||
| } | |||
| if !containsOnly(build, alphanum) { | |||
| return fmt.Errorf("Invalid character(s) found in build meta data %q", build) | |||
| } | |||
| } | |||
| return nil | |||
| } | |||
| // New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error | |||
| func New(s string) (*Version, error) { | |||
| v, err := Parse(s) | |||
| vp := &v | |||
| return vp, err | |||
| } | |||
| // Make is an alias for Parse, parses version string and returns a validated Version or error | |||
| func Make(s string) (Version, error) { | |||
| return Parse(s) | |||
| } | |||
| // ParseTolerant allows for certain version specifications that do not strictly adhere to semver | |||
| // specs to be parsed by this library. It does so by normalizing versions before passing them to | |||
| // Parse(). It currently trims spaces, removes a "v" prefix, adds a 0 patch number to versions | |||
| // with only major and minor components specified, and removes leading 0s. | |||
| func ParseTolerant(s string) (Version, error) { | |||
| s = strings.TrimSpace(s) | |||
| s = strings.TrimPrefix(s, "v") | |||
| // Split into major.minor.(patch+pr+meta) | |||
| parts := strings.SplitN(s, ".", 3) | |||
| // Remove leading zeros. | |||
| for i, p := range parts { | |||
| if len(p) > 1 { | |||
| p = strings.TrimLeft(p, "0") | |||
| if len(p) == 0 || !strings.ContainsAny(p[0:1], "0123456789") { | |||
| p = "0" + p | |||
| } | |||
| parts[i] = p | |||
| } | |||
| } | |||
| // Fill up shortened versions. | |||
| if len(parts) < 3 { | |||
| if strings.ContainsAny(parts[len(parts)-1], "+-") { | |||
| return Version{}, errors.New("Short version cannot contain PreRelease/Build meta data") | |||
| } | |||
| for len(parts) < 3 { | |||
| parts = append(parts, "0") | |||
| } | |||
| } | |||
| s = strings.Join(parts, ".") | |||
| return Parse(s) | |||
| } | |||
| // Parse parses version string and returns a validated Version or error | |||
| func Parse(s string) (Version, error) { | |||
| if len(s) == 0 { | |||
| return Version{}, errors.New("Version string empty") | |||
| } | |||
| // Split into major.minor.(patch+pr+meta) | |||
| parts := strings.SplitN(s, ".", 3) | |||
| if len(parts) != 3 { | |||
| return Version{}, errors.New("No Major.Minor.Patch elements found") | |||
| } | |||
| // Major | |||
| if !containsOnly(parts[0], numbers) { | |||
| return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0]) | |||
| } | |||
| if hasLeadingZeroes(parts[0]) { | |||
| return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0]) | |||
| } | |||
| major, err := strconv.ParseUint(parts[0], 10, 64) | |||
| if err != nil { | |||
| return Version{}, err | |||
| } | |||
| // Minor | |||
| if !containsOnly(parts[1], numbers) { | |||
| return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1]) | |||
| } | |||
| if hasLeadingZeroes(parts[1]) { | |||
| return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1]) | |||
| } | |||
| minor, err := strconv.ParseUint(parts[1], 10, 64) | |||
| if err != nil { | |||
| return Version{}, err | |||
| } | |||
| v := Version{} | |||
| v.Major = major | |||
| v.Minor = minor | |||
| var build, prerelease []string | |||
| patchStr := parts[2] | |||
| if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 { | |||
| build = strings.Split(patchStr[buildIndex+1:], ".") | |||
| patchStr = patchStr[:buildIndex] | |||
| } | |||
| if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 { | |||
| prerelease = strings.Split(patchStr[preIndex+1:], ".") | |||
| patchStr = patchStr[:preIndex] | |||
| } | |||
| if !containsOnly(patchStr, numbers) { | |||
| return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr) | |||
| } | |||
| if hasLeadingZeroes(patchStr) { | |||
| return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr) | |||
| } | |||
| patch, err := strconv.ParseUint(patchStr, 10, 64) | |||
| if err != nil { | |||
| return Version{}, err | |||
| } | |||
| v.Patch = patch | |||
| // Prerelease | |||
| for _, prstr := range prerelease { | |||
| parsedPR, err := NewPRVersion(prstr) | |||
| if err != nil { | |||
| return Version{}, err | |||
| } | |||
| v.Pre = append(v.Pre, parsedPR) | |||
| } | |||
| // Build meta data | |||
| for _, str := range build { | |||
| if len(str) == 0 { | |||
| return Version{}, errors.New("Build meta data is empty") | |||
| } | |||
| if !containsOnly(str, alphanum) { | |||
| return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str) | |||
| } | |||
| v.Build = append(v.Build, str) | |||
| } | |||
| return v, nil | |||
| } | |||
| // MustParse is like Parse but panics if the version cannot be parsed. | |||
| func MustParse(s string) Version { | |||
| v, err := Parse(s) | |||
| if err != nil { | |||
| panic(`semver: Parse(` + s + `): ` + err.Error()) | |||
| } | |||
| return v | |||
| } | |||
| // PRVersion represents a PreRelease Version | |||
| type PRVersion struct { | |||
| VersionStr string | |||
| VersionNum uint64 | |||
| IsNum bool | |||
| } | |||
| // NewPRVersion creates a new valid prerelease version | |||
| func NewPRVersion(s string) (PRVersion, error) { | |||
| if len(s) == 0 { | |||
| return PRVersion{}, errors.New("Prerelease is empty") | |||
| } | |||
| v := PRVersion{} | |||
| if containsOnly(s, numbers) { | |||
| if hasLeadingZeroes(s) { | |||
| return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s) | |||
| } | |||
| num, err := strconv.ParseUint(s, 10, 64) | |||
| // Might never be hit, but just in case | |||
| if err != nil { | |||
| return PRVersion{}, err | |||
| } | |||
| v.VersionNum = num | |||
| v.IsNum = true | |||
| } else if containsOnly(s, alphanum) { | |||
| v.VersionStr = s | |||
| v.IsNum = false | |||
| } else { | |||
| return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s) | |||
| } | |||
| return v, nil | |||
| } | |||
| // IsNumeric checks if prerelease-version is numeric | |||
| func (v PRVersion) IsNumeric() bool { | |||
| return v.IsNum | |||
| } | |||
| // Compare compares two PreRelease Versions v and o: | |||
| // -1 == v is less than o | |||
| // 0 == v is equal to o | |||
| // 1 == v is greater than o | |||
| func (v PRVersion) Compare(o PRVersion) int { | |||
| if v.IsNum && !o.IsNum { | |||
| return -1 | |||
| } else if !v.IsNum && o.IsNum { | |||
| return 1 | |||
| } else if v.IsNum && o.IsNum { | |||
| if v.VersionNum == o.VersionNum { | |||
| return 0 | |||
| } else if v.VersionNum > o.VersionNum { | |||
| return 1 | |||
| } else { | |||
| return -1 | |||
| } | |||
| } else { // both are Alphas | |||
| if v.VersionStr == o.VersionStr { | |||
| return 0 | |||
| } else if v.VersionStr > o.VersionStr { | |||
| return 1 | |||
| } else { | |||
| return -1 | |||
| } | |||
| } | |||
| } | |||
| // PreRelease version to string | |||
| func (v PRVersion) String() string { | |||
| if v.IsNum { | |||
| return strconv.FormatUint(v.VersionNum, 10) | |||
| } | |||
| return v.VersionStr | |||
| } | |||
| func containsOnly(s string, set string) bool { | |||
| return strings.IndexFunc(s, func(r rune) bool { | |||
| return !strings.ContainsRune(set, r) | |||
| }) == -1 | |||
| } | |||
| func hasLeadingZeroes(s string) bool { | |||
| return len(s) > 1 && s[0] == '0' | |||
| } | |||
| // NewBuildVersion creates a new valid build version | |||
| func NewBuildVersion(s string) (string, error) { | |||
| if len(s) == 0 { | |||
| return "", errors.New("Buildversion is empty") | |||
| } | |||
| if !containsOnly(s, alphanum) { | |||
| return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s) | |||
| } | |||
| return s, nil | |||
| } | |||
| // FinalizeVersion returns the major, minor and patch number only and discards | |||
| // prerelease and build number. | |||
| func FinalizeVersion(s string) (string, error) { | |||
| v, err := Parse(s) | |||
| if err != nil { | |||
| return "", err | |||
| } | |||
| v.Pre = nil | |||
| v.Build = nil | |||
| finalVer := v.String() | |||
| return finalVer, nil | |||
| } | |||
| @@ -0,0 +1,28 @@ | |||
| package semver | |||
| import ( | |||
| "sort" | |||
| ) | |||
| // Versions represents multiple versions. | |||
| type Versions []Version | |||
| // Len returns length of version collection | |||
| func (s Versions) Len() int { | |||
| return len(s) | |||
| } | |||
| // Swap swaps two versions inside the collection by its indices | |||
| func (s Versions) Swap(i, j int) { | |||
| s[i], s[j] = s[j], s[i] | |||
| } | |||
| // Less checks if version at index i is less than version at index j | |||
| func (s Versions) Less(i, j int) bool { | |||
| return s[i].LT(s[j]) | |||
| } | |||
| // Sort sorts a slice of versions | |||
| func Sort(versions []Version) { | |||
| sort.Sort(Versions(versions)) | |||
| } | |||
| @@ -0,0 +1,30 @@ | |||
| package semver | |||
| import ( | |||
| "database/sql/driver" | |||
| "fmt" | |||
| ) | |||
| // Scan implements the database/sql.Scanner interface. | |||
| func (v *Version) Scan(src interface{}) (err error) { | |||
| var str string | |||
| switch src := src.(type) { | |||
| case string: | |||
| str = src | |||
| case []byte: | |||
| str = string(src) | |||
| default: | |||
| return fmt.Errorf("version.Scan: cannot convert %T to string", src) | |||
| } | |||
| if t, err := Parse(str); err == nil { | |||
| *v = t | |||
| } | |||
| return | |||
| } | |||
| // Value implements the database/sql/driver.Valuer interface. | |||
| func (v Version) Value() (driver.Value, error) { | |||
| return v.String(), nil | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| Copyright (c) 2016 Caleb Spare | |||
| MIT License | |||
| Permission is hereby granted, free of charge, to any person obtaining | |||
| a copy of this software and associated documentation files (the | |||
| "Software"), to deal in the Software without restriction, including | |||
| without limitation the rights to use, copy, modify, merge, publish, | |||
| distribute, sublicense, and/or sell copies of the Software, and to | |||
| permit persons to whom the Software is furnished to do so, subject to | |||
| the following conditions: | |||
| The above copyright notice and this permission notice shall be | |||
| included in all copies or substantial portions of the Software. | |||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | |||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | |||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
| @@ -0,0 +1,72 @@ | |||
| # xxhash | |||
| [](https://pkg.go.dev/github.com/cespare/xxhash/v2) | |||
| [](https://github.com/cespare/xxhash/actions/workflows/test.yml) | |||
| xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a | |||
| high-quality hashing algorithm that is much faster than anything in the Go | |||
| standard library. | |||
| This package provides a straightforward API: | |||
| ``` | |||
| func Sum64(b []byte) uint64 | |||
| func Sum64String(s string) uint64 | |||
| type Digest struct{ ... } | |||
| func New() *Digest | |||
| ``` | |||
| The `Digest` type implements hash.Hash64. Its key methods are: | |||
| ``` | |||
| func (*Digest) Write([]byte) (int, error) | |||
| func (*Digest) WriteString(string) (int, error) | |||
| func (*Digest) Sum64() uint64 | |||
| ``` | |||
| The package is written with optimized pure Go and also contains even faster | |||
| assembly implementations for amd64 and arm64. If desired, the `purego` build tag | |||
| opts into using the Go code even on those architectures. | |||
| [xxHash]: http://cyan4973.github.io/xxHash/ | |||
| ## Compatibility | |||
| This package is in a module and the latest code is in version 2 of the module. | |||
| You need a version of Go with at least "minimal module compatibility" to use | |||
| github.com/cespare/xxhash/v2: | |||
| * 1.9.7+ for Go 1.9 | |||
| * 1.10.3+ for Go 1.10 | |||
| * Go 1.11 or later | |||
| I recommend using the latest release of Go. | |||
| ## Benchmarks | |||
| Here are some quick benchmarks comparing the pure-Go and assembly | |||
| implementations of Sum64. | |||
| | input size | purego | asm | | |||
| | ---------- | --------- | --------- | | |||
| | 4 B | 1.3 GB/s | 1.2 GB/s | | |||
| | 16 B | 2.9 GB/s | 3.5 GB/s | | |||
| | 100 B | 6.9 GB/s | 8.1 GB/s | | |||
| | 4 KB | 11.7 GB/s | 16.7 GB/s | | |||
| | 10 MB | 12.0 GB/s | 17.3 GB/s | | |||
| These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C | |||
| CPU using the following commands under Go 1.19.2: | |||
| ``` | |||
| benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$') | |||
| benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$') | |||
| ``` | |||
| ## Projects using this package | |||
| - [InfluxDB](https://github.com/influxdata/influxdb) | |||
| - [Prometheus](https://github.com/prometheus/prometheus) | |||
| - [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) | |||
| - [FreeCache](https://github.com/coocood/freecache) | |||
| - [FastCache](https://github.com/VictoriaMetrics/fastcache) | |||
| @@ -0,0 +1,10 @@ | |||
| #!/bin/bash | |||
| set -eu -o pipefail | |||
| # Small convenience script for running the tests with various combinations of | |||
| # arch/tags. This assumes we're running on amd64 and have qemu available. | |||
| go test ./... | |||
| go test -tags purego ./... | |||
| GOARCH=arm64 go test | |||
| GOARCH=arm64 go test -tags purego | |||
| @@ -0,0 +1,228 @@ | |||
| // Package xxhash implements the 64-bit variant of xxHash (XXH64) as described | |||
| // at http://cyan4973.github.io/xxHash/. | |||
| package xxhash | |||
| import ( | |||
| "encoding/binary" | |||
| "errors" | |||
| "math/bits" | |||
| ) | |||
| const ( | |||
| prime1 uint64 = 11400714785074694791 | |||
| prime2 uint64 = 14029467366897019727 | |||
| prime3 uint64 = 1609587929392839161 | |||
| prime4 uint64 = 9650029242287828579 | |||
| prime5 uint64 = 2870177450012600261 | |||
| ) | |||
| // Store the primes in an array as well. | |||
| // | |||
| // The consts are used when possible in Go code to avoid MOVs but we need a | |||
| // contiguous array of the assembly code. | |||
| var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5} | |||
| // Digest implements hash.Hash64. | |||
| type Digest struct { | |||
| v1 uint64 | |||
| v2 uint64 | |||
| v3 uint64 | |||
| v4 uint64 | |||
| total uint64 | |||
| mem [32]byte | |||
| n int // how much of mem is used | |||
| } | |||
| // New creates a new Digest that computes the 64-bit xxHash algorithm. | |||
| func New() *Digest { | |||
| var d Digest | |||
| d.Reset() | |||
| return &d | |||
| } | |||
| // Reset clears the Digest's state so that it can be reused. | |||
| func (d *Digest) Reset() { | |||
| d.v1 = primes[0] + prime2 | |||
| d.v2 = prime2 | |||
| d.v3 = 0 | |||
| d.v4 = -primes[0] | |||
| d.total = 0 | |||
| d.n = 0 | |||
| } | |||
| // Size always returns 8 bytes. | |||
| func (d *Digest) Size() int { return 8 } | |||
| // BlockSize always returns 32 bytes. | |||
| func (d *Digest) BlockSize() int { return 32 } | |||
| // Write adds more data to d. It always returns len(b), nil. | |||
| func (d *Digest) Write(b []byte) (n int, err error) { | |||
| n = len(b) | |||
| d.total += uint64(n) | |||
| memleft := d.mem[d.n&(len(d.mem)-1):] | |||
| if d.n+n < 32 { | |||
| // This new data doesn't even fill the current block. | |||
| copy(memleft, b) | |||
| d.n += n | |||
| return | |||
| } | |||
| if d.n > 0 { | |||
| // Finish off the partial block. | |||
| c := copy(memleft, b) | |||
| d.v1 = round(d.v1, u64(d.mem[0:8])) | |||
| d.v2 = round(d.v2, u64(d.mem[8:16])) | |||
| d.v3 = round(d.v3, u64(d.mem[16:24])) | |||
| d.v4 = round(d.v4, u64(d.mem[24:32])) | |||
| b = b[c:] | |||
| d.n = 0 | |||
| } | |||
| if len(b) >= 32 { | |||
| // One or more full blocks left. | |||
| nw := writeBlocks(d, b) | |||
| b = b[nw:] | |||
| } | |||
| // Store any remaining partial block. | |||
| copy(d.mem[:], b) | |||
| d.n = len(b) | |||
| return | |||
| } | |||
| // Sum appends the current hash to b and returns the resulting slice. | |||
| func (d *Digest) Sum(b []byte) []byte { | |||
| s := d.Sum64() | |||
| return append( | |||
| b, | |||
| byte(s>>56), | |||
| byte(s>>48), | |||
| byte(s>>40), | |||
| byte(s>>32), | |||
| byte(s>>24), | |||
| byte(s>>16), | |||
| byte(s>>8), | |||
| byte(s), | |||
| ) | |||
| } | |||
| // Sum64 returns the current hash. | |||
| func (d *Digest) Sum64() uint64 { | |||
| var h uint64 | |||
| if d.total >= 32 { | |||
| v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 | |||
| h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) | |||
| h = mergeRound(h, v1) | |||
| h = mergeRound(h, v2) | |||
| h = mergeRound(h, v3) | |||
| h = mergeRound(h, v4) | |||
| } else { | |||
| h = d.v3 + prime5 | |||
| } | |||
| h += d.total | |||
| b := d.mem[:d.n&(len(d.mem)-1)] | |||
| for ; len(b) >= 8; b = b[8:] { | |||
| k1 := round(0, u64(b[:8])) | |||
| h ^= k1 | |||
| h = rol27(h)*prime1 + prime4 | |||
| } | |||
| if len(b) >= 4 { | |||
| h ^= uint64(u32(b[:4])) * prime1 | |||
| h = rol23(h)*prime2 + prime3 | |||
| b = b[4:] | |||
| } | |||
| for ; len(b) > 0; b = b[1:] { | |||
| h ^= uint64(b[0]) * prime5 | |||
| h = rol11(h) * prime1 | |||
| } | |||
| h ^= h >> 33 | |||
| h *= prime2 | |||
| h ^= h >> 29 | |||
| h *= prime3 | |||
| h ^= h >> 32 | |||
| return h | |||
| } | |||
| const ( | |||
| magic = "xxh\x06" | |||
| marshaledSize = len(magic) + 8*5 + 32 | |||
| ) | |||
| // MarshalBinary implements the encoding.BinaryMarshaler interface. | |||
| func (d *Digest) MarshalBinary() ([]byte, error) { | |||
| b := make([]byte, 0, marshaledSize) | |||
| b = append(b, magic...) | |||
| b = appendUint64(b, d.v1) | |||
| b = appendUint64(b, d.v2) | |||
| b = appendUint64(b, d.v3) | |||
| b = appendUint64(b, d.v4) | |||
| b = appendUint64(b, d.total) | |||
| b = append(b, d.mem[:d.n]...) | |||
| b = b[:len(b)+len(d.mem)-d.n] | |||
| return b, nil | |||
| } | |||
| // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. | |||
| func (d *Digest) UnmarshalBinary(b []byte) error { | |||
| if len(b) < len(magic) || string(b[:len(magic)]) != magic { | |||
| return errors.New("xxhash: invalid hash state identifier") | |||
| } | |||
| if len(b) != marshaledSize { | |||
| return errors.New("xxhash: invalid hash state size") | |||
| } | |||
| b = b[len(magic):] | |||
| b, d.v1 = consumeUint64(b) | |||
| b, d.v2 = consumeUint64(b) | |||
| b, d.v3 = consumeUint64(b) | |||
| b, d.v4 = consumeUint64(b) | |||
| b, d.total = consumeUint64(b) | |||
| copy(d.mem[:], b) | |||
| d.n = int(d.total % uint64(len(d.mem))) | |||
| return nil | |||
| } | |||
| func appendUint64(b []byte, x uint64) []byte { | |||
| var a [8]byte | |||
| binary.LittleEndian.PutUint64(a[:], x) | |||
| return append(b, a[:]...) | |||
| } | |||
| func consumeUint64(b []byte) ([]byte, uint64) { | |||
| x := u64(b) | |||
| return b[8:], x | |||
| } | |||
| func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } | |||
| func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } | |||
| func round(acc, input uint64) uint64 { | |||
| acc += input * prime2 | |||
| acc = rol31(acc) | |||
| acc *= prime1 | |||
| return acc | |||
| } | |||
| func mergeRound(acc, val uint64) uint64 { | |||
| val = round(0, val) | |||
| acc ^= val | |||
| acc = acc*prime1 + prime4 | |||
| return acc | |||
| } | |||
| func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } | |||
| func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } | |||
| func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } | |||
| func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } | |||
| func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } | |||
| func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } | |||
| func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } | |||
| func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } | |||