├── .buildkite └── pipeline.yml ├── .github └── workflows │ ├── ci.yml │ ├── gem-push.yml │ └── licensed.yml ├── .gitignore ├── .licensed.yml ├── .licenses ├── bundler │ ├── bundler.dep.yml │ ├── ffi.dep.yml │ └── planetscale.dep.yml └── go │ ├── github.com │ ├── armon │ │ └── circbuf.dep.yml │ ├── gorilla │ │ └── mux.dep.yml │ ├── hashicorp │ │ └── go-cleanhttp.dep.yml │ ├── matoous │ │ └── go-nanoid │ │ │ └── v2.dep.yml │ ├── mitchellh │ │ └── go-homedir.dep.yml │ ├── pkg │ │ └── errors.dep.yml │ └── planetscale │ │ ├── planetscale-go │ │ └── planetscale.dep.yml │ │ └── sql-proxy │ │ └── proxy.dep.yml │ ├── go.uber.org │ ├── atomic.dep.yml │ ├── multierr.dep.yml │ ├── zap.dep.yml │ └── zap │ │ ├── buffer.dep.yml │ │ ├── internal │ │ ├── bufferpool.dep.yml │ │ ├── color.dep.yml │ │ └── exit.dep.yml │ │ └── zapcore.dep.yml │ └── golang.org │ └── x │ ├── net │ └── context │ │ └── ctxhttp.dep.yml │ ├── oauth2.dep.yml │ └── oauth2 │ └── internal.dep.yml ├── .ruby_version ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── bin ├── build-darwin ├── build-linux ├── console └── setup ├── controller.go ├── go.mod ├── go.sum ├── lib ├── generators │ └── planetscale │ │ └── install_generator.rb ├── planetscale.rb └── planetscale │ └── version.rb ├── planetscale.gemspec ├── proxy.go ├── test └── test_psdb.rb └── vendor ├── github.com ├── armon │ └── circbuf │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── circbuf.go │ │ └── go.mod ├── golang │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ └── proto │ │ ├── buffer.go │ │ ├── defaults.go │ │ ├── deprecated.go │ │ ├── discard.go │ │ ├── extensions.go │ │ ├── properties.go │ │ ├── proto.go │ │ ├── registry.go │ │ ├── text_decode.go │ │ ├── text_encode.go │ │ ├── wire.go │ │ └── wrappers.go ├── gorilla │ └── mux │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.mod │ │ ├── middleware.go │ │ ├── mux.go │ │ ├── regexp.go │ │ ├── route.go │ │ └── test_helpers.go ├── hashicorp │ └── go-cleanhttp │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cleanhttp.go │ │ ├── doc.go │ │ ├── go.mod │ │ └── handlers.go ├── matoous │ └── go-nanoid │ │ └── v2 │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── go.mod │ │ ├── go.sum │ │ └── gonanoid.go ├── mitchellh │ └── go-homedir │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go.mod │ │ └── homedir.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── errors.go │ │ ├── go113.go │ │ └── stack.go └── planetscale │ ├── planetscale-go │ ├── LICENSE │ └── planetscale │ │ ├── audit_logs.go │ │ ├── backups.go │ │ ├── branches.go │ │ ├── certificates.go │ │ ├── client.go │ │ ├── databases.go │ │ ├── deploy_requests.go │ │ ├── imports.go │ │ ├── organizations.go │ │ ├── passwords.go │ │ ├── regions.go │ │ └── service_tokens.go │ └── sql-proxy │ ├── LICENSE │ └── proxy │ ├── client.go │ └── tls_cache.go ├── go.uber.org ├── atomic │ ├── .codecov.yml │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── Makefile │ ├── README.md │ ├── bool.go │ ├── bool_ext.go │ ├── doc.go │ ├── duration.go │ ├── duration_ext.go │ ├── error.go │ ├── error_ext.go │ ├── float64.go │ ├── float64_ext.go │ ├── gen.go │ ├── go.mod │ ├── go.sum │ ├── int32.go │ ├── int64.go │ ├── nocmp.go │ ├── string.go │ ├── string_ext.go │ ├── time.go │ ├── time_ext.go │ ├── uint32.go │ ├── uint64.go │ ├── uintptr.go │ ├── unsafe_pointer.go │ └── value.go ├── multierr │ ├── .codecov.yml │ ├── .gitignore │ ├── CHANGELOG.md │ ├── LICENSE.txt │ ├── Makefile │ ├── README.md │ ├── error.go │ ├── glide.yaml │ ├── go.mod │ └── go.sum └── zap │ ├── .codecov.yml │ ├── .gitignore │ ├── .readme.tmpl │ ├── CHANGELOG.md │ ├── CODE_OF_CONDUCT.md │ ├── CONTRIBUTING.md │ ├── FAQ.md │ ├── LICENSE.txt │ ├── Makefile │ ├── README.md │ ├── array.go │ ├── buffer │ ├── buffer.go │ └── pool.go │ ├── checklicense.sh │ ├── config.go │ ├── doc.go │ ├── encoder.go │ ├── error.go │ ├── field.go │ ├── flag.go │ ├── glide.yaml │ ├── global.go │ ├── go.mod │ ├── go.sum │ ├── http_handler.go │ ├── internal │ ├── bufferpool │ │ └── bufferpool.go │ ├── color │ │ └── color.go │ └── exit │ │ └── exit.go │ ├── level.go │ ├── logger.go │ ├── options.go │ ├── sink.go │ ├── stacktrace.go │ ├── sugar.go │ ├── time.go │ ├── writer.go │ └── zapcore │ ├── buffered_write_syncer.go │ ├── clock.go │ ├── console_encoder.go │ ├── core.go │ ├── doc.go │ ├── encoder.go │ ├── entry.go │ ├── error.go │ ├── field.go │ ├── hook.go │ ├── increase_level.go │ ├── json_encoder.go │ ├── level.go │ ├── level_strings.go │ ├── marshaler.go │ ├── memory_encoder.go │ ├── reflected_encoder.go │ ├── sampler.go │ ├── tee.go │ └── write_syncer.go ├── golang.org └── x │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── context │ │ ├── context.go │ │ ├── ctxhttp │ │ └── ctxhttp.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ └── oauth2 │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── go.mod │ ├── go.sum │ ├── internal │ ├── client_appengine.go │ ├── doc.go │ ├── oauth2.go │ ├── token.go │ └── transport.go │ ├── oauth2.go │ ├── token.go │ └── transport.go ├── google.golang.org ├── appengine │ ├── LICENSE │ ├── internal │ │ ├── api.go │ │ ├── api_classic.go │ │ ├── api_common.go │ │ ├── app_id.go │ │ ├── base │ │ │ ├── api_base.pb.go │ │ │ └── api_base.proto │ │ ├── datastore │ │ │ ├── datastore_v3.pb.go │ │ │ └── datastore_v3.proto │ │ ├── identity.go │ │ ├── identity_classic.go │ │ ├── identity_flex.go │ │ ├── identity_vm.go │ │ ├── internal.go │ │ ├── log │ │ │ ├── log_service.pb.go │ │ │ └── log_service.proto │ │ ├── main.go │ │ ├── main_common.go │ │ ├── main_vm.go │ │ ├── metadata.go │ │ ├── net.go │ │ ├── regen.sh │ │ ├── remote_api │ │ │ ├── remote_api.pb.go │ │ │ └── remote_api.proto │ │ ├── transaction.go │ │ └── urlfetch │ │ │ ├── urlfetch_service.pb.go │ │ │ └── urlfetch_service.proto │ └── urlfetch │ │ └── urlfetch.go └── protobuf │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── encoding │ ├── prototext │ │ ├── decode.go │ │ ├── doc.go │ │ └── encode.go │ └── protowire │ │ └── wire.go │ ├── internal │ ├── descfmt │ │ └── stringer.go │ ├── descopts │ │ └── options.go │ ├── detrand │ │ └── rand.go │ ├── encoding │ │ ├── defval │ │ │ └── default.go │ │ ├── messageset │ │ │ └── messageset.go │ │ ├── tag │ │ │ └── tag.go │ │ └── text │ │ │ ├── decode.go │ │ │ ├── decode_number.go │ │ │ ├── decode_string.go │ │ │ ├── decode_token.go │ │ │ ├── doc.go │ │ │ └── encode.go │ ├── errors │ │ ├── errors.go │ │ ├── is_go112.go │ │ └── is_go113.go │ ├── filedesc │ │ ├── build.go │ │ ├── desc.go │ │ ├── desc_init.go │ │ ├── desc_lazy.go │ │ ├── desc_list.go │ │ ├── desc_list_gen.go │ │ └── placeholder.go │ ├── filetype │ │ └── build.go │ ├── flags │ │ ├── flags.go │ │ ├── proto_legacy_disable.go │ │ └── proto_legacy_enable.go │ ├── genid │ │ ├── any_gen.go │ │ ├── api_gen.go │ │ ├── descriptor_gen.go │ │ ├── doc.go │ │ ├── duration_gen.go │ │ ├── empty_gen.go │ │ ├── field_mask_gen.go │ │ ├── goname.go │ │ ├── map_entry.go │ │ ├── source_context_gen.go │ │ ├── struct_gen.go │ │ ├── timestamp_gen.go │ │ ├── type_gen.go │ │ ├── wrappers.go │ │ └── wrappers_gen.go │ ├── impl │ │ ├── api_export.go │ │ ├── checkinit.go │ │ ├── codec_extension.go │ │ ├── codec_field.go │ │ ├── codec_gen.go │ │ ├── codec_map.go │ │ ├── codec_map_go111.go │ │ ├── codec_map_go112.go │ │ ├── codec_message.go │ │ ├── codec_messageset.go │ │ ├── codec_reflect.go │ │ ├── codec_tables.go │ │ ├── codec_unsafe.go │ │ ├── convert.go │ │ ├── convert_list.go │ │ ├── convert_map.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── enum.go │ │ ├── extension.go │ │ ├── legacy_enum.go │ │ ├── legacy_export.go │ │ ├── legacy_extension.go │ │ ├── legacy_file.go │ │ ├── legacy_message.go │ │ ├── merge.go │ │ ├── merge_gen.go │ │ ├── message.go │ │ ├── message_reflect.go │ │ ├── message_reflect_field.go │ │ ├── message_reflect_gen.go │ │ ├── pointer_reflect.go │ │ ├── pointer_unsafe.go │ │ ├── validate.go │ │ └── weak.go │ ├── order │ │ ├── order.go │ │ └── range.go │ ├── pragma │ │ └── pragma.go │ ├── set │ │ └── ints.go │ ├── strs │ │ ├── strings.go │ │ ├── strings_pure.go │ │ └── strings_unsafe.go │ └── version │ │ └── version.go │ ├── proto │ ├── checkinit.go │ ├── decode.go │ ├── decode_gen.go │ ├── doc.go │ ├── encode.go │ ├── encode_gen.go │ ├── equal.go │ ├── extension.go │ ├── merge.go │ ├── messageset.go │ ├── proto.go │ ├── proto_methods.go │ ├── proto_reflect.go │ ├── reset.go │ ├── size.go │ ├── size_gen.go │ └── wrappers.go │ ├── reflect │ ├── protodesc │ │ ├── desc.go │ │ ├── desc_init.go │ │ ├── desc_resolve.go │ │ ├── desc_validate.go │ │ └── proto.go │ ├── protoreflect │ │ ├── methods.go │ │ ├── proto.go │ │ ├── source.go │ │ ├── source_gen.go │ │ ├── type.go │ │ ├── value.go │ │ ├── value_pure.go │ │ ├── value_union.go │ │ └── value_unsafe.go │ └── protoregistry │ │ └── registry.go │ ├── runtime │ ├── protoiface │ │ ├── legacy.go │ │ └── methods.go │ └── protoimpl │ │ ├── impl.go │ │ └── version.go │ └── types │ └── descriptorpb │ └── descriptor.pb.go └── modules.txt /.buildkite/pipeline.yml: -------------------------------------------------------------------------------- 1 | agents: 2 | queue: "public" 3 | 4 | steps: 5 | - name: "Go build" 6 | commands: 7 | - "go build -v -x -trimpath -ldflags='-s -w' -buildmode=c-shared -o planetscale-linux-x86_64.so.$BUILDKITE_COMMIT" 8 | - "buildkite-agent artifact upload planetscale-linux-x86_64.so.$BUILDKITE_COMMIT" 9 | plugins: 10 | - docker#v3.8.0: 11 | image: "golang:1.17.4" 12 | - wait 13 | - name: "Ruby build and test %n" 14 | commands: 15 | - "mkdir proxy" 16 | - "buildkite-agent artifact download planetscale-linux-x86_64.so.$BUILDKITE_COMMIT proxy/ && mv proxy/planetscale-linux-x86_64.so.$BUILDKITE_COMMIT proxy/planetscale-linux-x86_64.so" 17 | - "bundle install -j 8" 18 | - "bundle exec rake test" 19 | plugins: 20 | - docker#v3.8.0: 21 | image: "ruby:2.7-buster" 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Ruby Gem - Run Tests 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | build: 11 | name: Run Tests 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Set up Ruby 2.7 18 | uses: ruby/setup-ruby@v1 19 | with: 20 | ruby-version: 2.7.3 21 | bundler-cache: true 22 | 23 | - name: Install Golang 24 | uses: actions/setup-go@v2 25 | with: 26 | go-version: ^1.17 27 | 28 | - name: Build and Test 29 | run: | 30 | go build -v -buildmode=c-shared -trimpath -ldflags='-s -w' -o proxy/planetscale-linux-x86_64.so 31 | bundle exec rake test 32 | -------------------------------------------------------------------------------- /.github/workflows/gem-push.yml: -------------------------------------------------------------------------------- 1 | name: Ruby Gem - Build + Publish 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | 7 | jobs: 8 | build: 9 | name: Build + Publish 10 | runs-on: macos-11 11 | timeout-minutes: 35 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Set up Ruby 2.7 17 | uses: ruby/setup-ruby@v1 18 | with: 19 | ruby-version: 2.7.3 20 | bundler-cache: true 21 | 22 | - name: Add SHORT_SHA env property with commit short sha 23 | run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV 24 | 25 | - name: Install Golang 26 | uses: actions/setup-go@v2 27 | with: 28 | go-version: ^1.17 29 | 30 | - name: Build shared library on OS X 31 | run: bin/build-darwin 32 | 33 | - name: Install Docker 34 | uses: docker-practice/actions-setup-docker@master 35 | 36 | - name: Build shared library on Linux 37 | run: docker run -v $(pwd):/planetscale-ruby golang sh -c 'cd /planetscale-ruby && bin/build-linux' 38 | 39 | - name: Publish to GPR 40 | run: | 41 | gem build *.gemspec 42 | gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem 43 | env: 44 | GEM_BUILD: 1 45 | GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" 46 | OWNER: ${{ github.repository_owner }} 47 | -------------------------------------------------------------------------------- /.github/workflows/licensed.yml: -------------------------------------------------------------------------------- 1 | name: licensed-ci 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | pull_request: 9 | 10 | jobs: 11 | licensed: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v2 16 | 17 | - name: Install licensed 18 | uses: jonabc/setup-licensed@v1 19 | with: 20 | version: 2.x 21 | 22 | - name: Install go 23 | uses: actions/setup-go@v2 24 | with: 25 | go-version: ^1.16 26 | 27 | - name: Run licensed 28 | id: licensed 29 | uses: jonabc/licensed-ci@v1 30 | with: 31 | github_token: ${{ secrets.GITHUB_TOKEN }} 32 | 33 | - name: Report licensed activity 34 | uses: actions/github-script@0.2.0 35 | if: always() && steps.licensed.outputs.pr_number 36 | with: 37 | script: | 38 | github.issues.createComment({ 39 | owner: context.repo.owner, 40 | repo: context.repo.repo, 41 | issue_number: ${{ steps.licensed.outputs.pr_number }}, 42 | body: 'licensed has detected incompatible changes' 43 | }) 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /_yardoc/ 4 | /coverage/ 5 | /doc/ 6 | /pkg/ 7 | /proxy/ 8 | /spec/reports/ 9 | /tmp/ 10 | Gemfile.lock 11 | -------------------------------------------------------------------------------- /.licensed.yml: -------------------------------------------------------------------------------- 1 | sources: 2 | go: true 3 | bundler: true 4 | 5 | allowed: 6 | - mit 7 | - apache-2.0 8 | - bsd-2-clause 9 | - bsd-3-clause 10 | - mpl-2.0 11 | -------------------------------------------------------------------------------- /.licenses/bundler/bundler.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: bundler 3 | version: 2.2.22 4 | type: bundler 5 | summary: The best way to manage your application's dependencies 6 | homepage: https://bundler.io 7 | license: mit 8 | licenses: 9 | - sources: Auto-generated MIT license text 10 | text: | 11 | MIT License 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in all 21 | copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/github.com/armon/circbuf.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: github.com/armon/circbuf 3 | version: v0.0.0-20190214190532-5111143e8da2 4 | type: go 5 | summary: 6 | homepage: https://godoc.org/github.com/armon/circbuf 7 | license: mit 8 | licenses: 9 | - sources: LICENSE 10 | text: | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2013 Armon Dadgar 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 19 | the Software, and to permit persons to whom the Software is furnished to do so, 20 | subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 27 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 28 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 29 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 30 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | notices: [] 32 | -------------------------------------------------------------------------------- /.licenses/go/github.com/matoous/go-nanoid/v2.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: github.com/matoous/go-nanoid/v2 3 | version: v2.0.0 4 | type: go 5 | summary: 6 | homepage: https://godoc.org/github.com/matoous/go-nanoid/v2 7 | license: mit 8 | licenses: 9 | - sources: LICENSE 10 | text: | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2018 Matous Dzivjak 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in 23 | all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 31 | THE SOFTWARE. 32 | - sources: README.md 33 | text: The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 34 | notices: [] 35 | -------------------------------------------------------------------------------- /.licenses/go/github.com/mitchellh/go-homedir.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: github.com/mitchellh/go-homedir 3 | version: v1.1.0 4 | type: go 5 | summary: 6 | homepage: https://godoc.org/github.com/mitchellh/go-homedir 7 | license: mit 8 | licenses: 9 | - sources: LICENSE 10 | text: | 11 | The MIT License (MIT) 12 | 13 | Copyright (c) 2013 Mitchell Hashimoto 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in 23 | all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 31 | THE SOFTWARE. 32 | notices: [] 33 | -------------------------------------------------------------------------------- /.licenses/go/github.com/pkg/errors.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: github.com/pkg/errors 3 | version: v0.9.1 4 | type: go 5 | summary: Package errors provides simple error handling primitives. 6 | homepage: https://godoc.org/github.com/pkg/errors 7 | license: bsd-2-clause 8 | licenses: 9 | - sources: LICENSE 10 | text: | 11 | Copyright (c) 2015, Dave Cheney 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, this 18 | list of conditions and the following disclaimer. 19 | 20 | * Redistributions in binary form must reproduce the above copyright notice, 21 | this list of conditions and the following disclaimer in the documentation 22 | and/or other materials provided with the distribution. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | - sources: README.md 35 | text: BSD-2-Clause 36 | notices: [] 37 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/atomic.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/atomic 3 | version: v1.9.0 4 | type: go 5 | summary: Package atomic provides simple wrappers around numerics to enforce atomic 6 | access. 7 | homepage: https://godoc.org/go.uber.org/atomic 8 | license: mit 9 | licenses: 10 | - sources: LICENSE.txt 11 | text: | 12 | Copyright (c) 2016 Uber Technologies, Inc. 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in 22 | all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | THE SOFTWARE. 31 | notices: [] 32 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/multierr.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/multierr 3 | version: v1.8.0 4 | type: go 5 | summary: Package multierr allows combining one or more errors together. 6 | homepage: https://godoc.org/go.uber.org/multierr 7 | license: mit 8 | licenses: 9 | - sources: LICENSE.txt 10 | text: | 11 | Copyright (c) 2017-2021 Uber Technologies, Inc. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap 3 | version: v1.21.0 4 | type: go 5 | summary: Package zap provides fast, structured, leveled logging. 6 | homepage: https://godoc.org/go.uber.org/zap 7 | license: mit 8 | licenses: 9 | - sources: LICENSE.txt 10 | text: | 11 | Copyright (c) 2016-2017 Uber Technologies, Inc. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap/buffer.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap/buffer 3 | version: v1.21.0 4 | type: go 5 | summary: Package buffer provides a thin wrapper around a byte slice. 6 | homepage: https://godoc.org/go.uber.org/zap/buffer 7 | license: mit 8 | licenses: 9 | - sources: zap/LICENSE.txt 10 | text: | 11 | Copyright (c) 2016-2017 Uber Technologies, Inc. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap/internal/bufferpool.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap/internal/bufferpool 3 | version: v1.21.0 4 | type: go 5 | summary: Package bufferpool houses zap's shared internal buffer pool. 6 | homepage: https://godoc.org/go.uber.org/zap/internal/bufferpool 7 | license: mit 8 | licenses: 9 | - sources: zap/LICENSE.txt 10 | text: | 11 | Copyright (c) 2016-2017 Uber Technologies, Inc. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap/internal/color.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap/internal/color 3 | version: v1.21.0 4 | type: go 5 | summary: Package color adds coloring functionality for TTY output. 6 | homepage: https://godoc.org/go.uber.org/zap/internal/color 7 | license: mit 8 | licenses: 9 | - sources: zap/LICENSE.txt 10 | text: | 11 | Copyright (c) 2016-2017 Uber Technologies, Inc. 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy 14 | of this software and associated documentation files (the "Software"), to deal 15 | in the Software without restriction, including without limitation the rights 16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | copies of the Software, and to permit persons to whom the Software is 18 | furnished to do so, subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in 21 | all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 | THE SOFTWARE. 30 | notices: [] 31 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap/internal/exit.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap/internal/exit 3 | version: v1.21.0 4 | type: go 5 | summary: Package exit provides stubs so that unit tests can exercise code that calls 6 | os.Exit(1). 7 | homepage: https://godoc.org/go.uber.org/zap/internal/exit 8 | license: mit 9 | licenses: 10 | - sources: zap/LICENSE.txt 11 | text: | 12 | Copyright (c) 2016-2017 Uber Technologies, Inc. 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in 22 | all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | THE SOFTWARE. 31 | notices: [] 32 | -------------------------------------------------------------------------------- /.licenses/go/go.uber.org/zap/zapcore.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: go.uber.org/zap/zapcore 3 | version: v1.21.0 4 | type: go 5 | summary: Package zapcore defines and implements the low-level interfaces upon which 6 | zap is built. 7 | homepage: https://godoc.org/go.uber.org/zap/zapcore 8 | license: mit 9 | licenses: 10 | - sources: zap/LICENSE.txt 11 | text: | 12 | Copyright (c) 2016-2017 Uber Technologies, Inc. 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in 22 | all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | THE SOFTWARE. 31 | notices: [] 32 | -------------------------------------------------------------------------------- /.licenses/go/golang.org/x/oauth2.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: golang.org/x/oauth2 3 | version: v0.0.0-20220628200809-02e64fa58f26 4 | type: go 5 | summary: Package oauth2 provides support for making OAuth2 authorized and authenticated 6 | HTTP requests, as specified in RFC 6749. 7 | homepage: https://godoc.org/golang.org/x/oauth2 8 | license: bsd-3-clause 9 | licenses: 10 | - sources: LICENSE 11 | text: | 12 | Copyright (c) 2009 The Go Authors. All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are 16 | met: 17 | 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above 21 | copyright notice, this list of conditions and the following disclaimer 22 | in the documentation and/or other materials provided with the 23 | distribution. 24 | * Neither the name of Google Inc. nor the names of its 25 | contributors may be used to endorse or promote products derived from 26 | this software without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | notices: 40 | - sources: AUTHORS 41 | text: |- 42 | # This source code refers to The Go Authors for copyright purposes. 43 | # The master list of authors is in the main Go distribution, 44 | # visible at http://tip.golang.org/AUTHORS. 45 | -------------------------------------------------------------------------------- /.licenses/go/golang.org/x/oauth2/internal.dep.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: golang.org/x/oauth2/internal 3 | version: v0.0.0-20220628200809-02e64fa58f26 4 | type: go 5 | summary: Package internal contains support packages for oauth2 package. 6 | homepage: https://godoc.org/golang.org/x/oauth2/internal 7 | license: bsd-3-clause 8 | licenses: 9 | - sources: oauth2/LICENSE 10 | text: | 11 | Copyright (c) 2009 The Go Authors. All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are 15 | met: 16 | 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the following disclaimer 21 | in the documentation and/or other materials provided with the 22 | distribution. 23 | * Neither the name of Google Inc. nor the names of its 24 | contributors may be used to endorse or promote products derived from 25 | this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | notices: [] 39 | -------------------------------------------------------------------------------- /.ruby_version: -------------------------------------------------------------------------------- 1 | 2.7.2 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } 6 | 7 | # Specify your gem's dependencies in planetscale.gemspec 8 | gemspec 9 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | require 'rake/testtask' 4 | 5 | Rake::TestTask.new do |t| 6 | t.libs << 'test' 7 | end 8 | 9 | desc "Run tests" 10 | task :default => :test 11 | -------------------------------------------------------------------------------- /bin/build-darwin: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags '-w -s' -buildmode=c-shared -o proxy/planetscale-darwin-x86_64.so 5 | CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags '-w -s' -buildmode=c-shared -o proxy/planetscale-darwin-arm64.so 6 | 7 | rm proxy/*.h 8 | 9 | file proxy/planetscale-darwin-x86_64.so 10 | file proxy/planetscale-darwin-arm64.so 11 | -------------------------------------------------------------------------------- /bin/build-linux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | apt-get update && apt-get install --no-install-recommends --yes gcc-aarch64-linux-gnu gcc-mingw-w64 libc6-dev-arm64-cross file 5 | 6 | CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags '-w -s' -buildmode=c-shared -o proxy/planetscale-linux-x86_64.so 7 | CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -trimpath -ldflags='-w -s' -buildmode=c-shared -o proxy/planetscale-linux-arm64.so 8 | CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc go build -trimpath -ldflags='-w -s' -buildmode=c-shared -o proxy/planetscale-windows-x86_64.so 9 | 10 | rm proxy/*.h 11 | 12 | file proxy/planetscale-linux-x86_64.so 13 | file proxy/planetscale-linux-arm64.so 14 | file proxy/planetscale-windows-x86_64.so 15 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # frozen_string_literal: true 3 | 4 | require 'bundler/setup' 5 | require 'planetscale' 6 | 7 | # You can add fixtures and/or initialization code here to make experimenting 8 | # with your gem easier. You can also use a different console, if you like. 9 | 10 | # (If you use this, don't forget to add pry to your Gemfile!) 11 | # require "pry" 12 | # Pry.start 13 | 14 | require 'irb' 15 | IRB.start(__FILE__) 16 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | set -vx 5 | 6 | bundle install 7 | 8 | OS="`uname`" 9 | case $OS in 10 | 'Darwin') 11 | bin/build-darwin 12 | ;; 13 | 'Linux') 14 | go build -v -buildmode=c-shared -trimpath -ldflags='-s -w' -o proxy/planetscale-linux-x86_64.so 15 | ;; 16 | *) ;; 17 | esac 18 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 7 | github.com/golang/protobuf v1.5.2 // indirect 8 | github.com/gorilla/mux v1.8.0 9 | github.com/matoous/go-nanoid/v2 v2.0.0 10 | github.com/mitchellh/go-homedir v1.1.0 11 | github.com/planetscale/planetscale-go v0.65.0 12 | github.com/planetscale/sql-proxy v0.13.0 13 | go.uber.org/atomic v1.9.0 // indirect 14 | go.uber.org/multierr v1.8.0 // indirect 15 | go.uber.org/zap v1.21.0 16 | golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect 17 | golang.org/x/oauth2 v0.0.0-20220628200809-02e64fa58f26 // indirect 18 | google.golang.org/appengine v1.6.7 // indirect 19 | google.golang.org/protobuf v1.28.0 // indirect 20 | ) 21 | -------------------------------------------------------------------------------- /lib/generators/planetscale/install_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | 3 | class Planetscale 4 | class InstallGenerator < Rails::Generators::Base 5 | class_option :organization, type: :string, default: '' 6 | 7 | def read_config 8 | @database = "" 9 | file_path = File.join(Rails.root, PlanetScale::Proxy::PLANETSCALE_FILE) 10 | return unless File.exist?(file_path) 11 | 12 | data = YAML.safe_load(File.read(file_path)) 13 | @database = data['database'] 14 | @org = data['org'] 15 | end 16 | 17 | def check_org 18 | if options[:organization].empty? && @org.nil? 19 | puts "Usage: bundle exec rails g planetscale:install --organization ORG_NAME" 20 | abort 21 | end 22 | 23 | @org ||= options[:organization] 24 | end 25 | 26 | APPLICATION_REQUIRE_REGEX = /(require_relative ("|')application("|')\n)/.freeze 27 | 28 | def create_planetscale_config 29 | create_file "config/planetscale.rb", "PlanetScale.start(org: '#{@org}')\n" 30 | inject_into_file "config/environment.rb", after: APPLICATION_REQUIRE_REGEX do <<~'RUBY' 31 | require_relative "planetscale" 32 | RUBY 33 | end 34 | end 35 | 36 | # todo(nickvanw): When we get rid of DB passwords, this can mostly go away, and we can just 37 | # return the `DATABSE_URL` that the user should use. 38 | def print_database_yaml 39 | d = 40 | <<~EOS 41 | development: 42 | <<: *default 43 | username: root 44 | host: 127.0.0.1 45 | port: 3305 46 | database: #{@database} 47 | EOS 48 | 49 | 50 | db_url = "mysql2://root:@127.0.0.1:3305/#{@database}" 51 | puts "Installed!\n\nConfigure your database.yaml like so:\n".bold 52 | puts d 53 | puts "\nOr set DATABASE_URL=#{db_url}" 54 | end 55 | end 56 | end 57 | 58 | class String 59 | def bold; "\e[1m#{self}\e[22m" end 60 | end 61 | -------------------------------------------------------------------------------- /lib/planetscale/version.rb: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | module PlanetScale 4 | VERSION = '0.3.5' 5 | end 6 | -------------------------------------------------------------------------------- /planetscale.gemspec: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | lib = File.expand_path('lib', __dir__) 4 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 5 | require 'planetscale/version' 6 | 7 | Gem::Specification.new do |spec| 8 | spec.name = 'planetscale' 9 | spec.version = PlanetScale::VERSION 10 | spec.authors = ['Nick Van Wiggeren', 'Mike Coutermarsh', 'David Graham'] 11 | spec.email = ['nick@planetscale.com'] 12 | 13 | spec.summary = 'Ruby client for PlanetScale Databases' 14 | spec.homepage = 'https://planetscale.com/' 15 | spec.license = 'Apache-2.0' 16 | 17 | # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host' 18 | # to allow pushing to a single host or delete this section to allow pushing to any host. 19 | if spec.respond_to?(:metadata) 20 | spec.metadata['homepage_uri'] = spec.homepage 21 | spec.metadata['source_code_uri'] = 'https://github.com/planetscale/planetscale-ruby' 22 | spec.metadata['changelog_uri'] = 'https://github.com/planetscale/planetscale-ruby' 23 | spec.metadata['github_repo'] = 'ssh://github.com/planetscale/planetscale-ruby' 24 | else 25 | raise 'RubyGems 2.0 or newer is required to protect against ' \ 26 | 'public gem pushes.' 27 | end 28 | 29 | # Specify which files should be added to the gem when it is released. 30 | # The `git ls-files -z` loads the files in the RubyGem that have been added into git. 31 | spec.files = Dir.chdir(File.expand_path(__dir__)) do 32 | `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|vendor)/}) } + Dir.glob("proxy/*") 33 | end 34 | spec.bindir = 'exe' 35 | spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } 36 | spec.require_paths = ['lib'] 37 | 38 | spec.add_development_dependency 'bundler', '~> 2' 39 | spec.add_development_dependency 'rake', '>= 12.3.3' 40 | spec.add_development_dependency 'pry' 41 | spec.add_development_dependency 'minitest' 42 | 43 | spec.add_runtime_dependency 'ffi', '~> 1' 44 | end 45 | -------------------------------------------------------------------------------- /test/test_psdb.rb: -------------------------------------------------------------------------------- 1 | require 'minitest/autorun' 2 | require 'planetscale' 3 | require 'pry' 4 | 5 | class PlanetScaleTest < Minitest::Test 6 | def test_empty_config 7 | assert_raises ArgumentError do 8 | PlanetScale::Proxy.new 9 | end 10 | end 11 | 12 | def test_environment_config 13 | p = PlanetScale::Proxy.new(branch: 'test', org: 'testorg', db: 'testdb') 14 | 15 | assert_equal p.instance_variable_get(:@db), 'testdb' 16 | assert_equal p.instance_variable_get(:@branch), 'test' 17 | assert_equal p.instance_variable_get(:@org), 'testorg' 18 | assert_equal p.instance_variable_get(:@auth_method), PlanetScale::Proxy::AUTH_AUTO 19 | end 20 | 21 | def test_auto_with_service_token 22 | p = PlanetScale::Proxy.new(branch: 'test', org: 'testorg', db: 'testdb', token_id: 123, token: 456) 23 | 24 | assert_equal p.instance_variable_get(:@auth_method), PlanetScale::Proxy::AUTH_SERVICE_TOKEN 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /vendor/github.com/armon/circbuf/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/armon/circbuf/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Armon Dadgar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/armon/circbuf/README.md: -------------------------------------------------------------------------------- 1 | circbuf 2 | ======= 3 | 4 | This repository provides the `circbuf` package. This provides a `Buffer` object 5 | which is a circular (or ring) buffer. It has a fixed size, but can be written 6 | to infinitely. Only the last `size` bytes are ever retained. The buffer implements 7 | the `io.Writer` interface. 8 | 9 | Documentation 10 | ============= 11 | 12 | Full documentation can be found on [Godoc](http://godoc.org/github.com/armon/circbuf) 13 | 14 | Usage 15 | ===== 16 | 17 | The `circbuf` package is very easy to use: 18 | 19 | ```go 20 | buf, _ := NewBuffer(6) 21 | buf.Write([]byte("hello world")) 22 | 23 | if string(buf.Bytes()) != " world" { 24 | panic("should only have last 6 bytes!") 25 | } 26 | 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/armon/circbuf/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/armon/circbuf 2 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2010 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/defaults.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // SetDefaults sets unpopulated scalar fields to their default values. 12 | // Fields within a oneof are not set even if they have a default value. 13 | // SetDefaults is recursively called upon any populated message fields. 14 | func SetDefaults(m Message) { 15 | if m != nil { 16 | setDefaults(MessageReflect(m)) 17 | } 18 | } 19 | 20 | func setDefaults(m protoreflect.Message) { 21 | fds := m.Descriptor().Fields() 22 | for i := 0; i < fds.Len(); i++ { 23 | fd := fds.Get(i) 24 | if !m.Has(fd) { 25 | if fd.HasDefault() && fd.ContainingOneof() == nil { 26 | v := fd.Default() 27 | if fd.Kind() == protoreflect.BytesKind { 28 | v = protoreflect.ValueOf(append([]byte(nil), v.Bytes()...)) // copy the default bytes 29 | } 30 | m.Set(fd, v) 31 | } 32 | continue 33 | } 34 | } 35 | 36 | m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { 37 | switch { 38 | // Handle singular message. 39 | case fd.Cardinality() != protoreflect.Repeated: 40 | if fd.Message() != nil { 41 | setDefaults(m.Get(fd).Message()) 42 | } 43 | // Handle list of messages. 44 | case fd.IsList(): 45 | if fd.Message() != nil { 46 | ls := m.Get(fd).List() 47 | for i := 0; i < ls.Len(); i++ { 48 | setDefaults(ls.Get(i).Message()) 49 | } 50 | } 51 | // Handle map of messages. 52 | case fd.IsMap(): 53 | if fd.MapValue().Message() != nil { 54 | ms := m.Get(fd).Map() 55 | ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { 56 | setDefaults(v.Message()) 57 | return true 58 | }) 59 | } 60 | } 61 | return true 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/discard.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/reflect/protoreflect" 9 | ) 10 | 11 | // DiscardUnknown recursively discards all unknown fields from this message 12 | // and all embedded messages. 13 | // 14 | // When unmarshaling a message with unrecognized fields, the tags and values 15 | // of such fields are preserved in the Message. This allows a later call to 16 | // marshal to be able to produce a message that continues to have those 17 | // unrecognized fields. To avoid this, DiscardUnknown is used to 18 | // explicitly clear the unknown fields after unmarshaling. 19 | func DiscardUnknown(m Message) { 20 | if m != nil { 21 | discardUnknown(MessageReflect(m)) 22 | } 23 | } 24 | 25 | func discardUnknown(m protoreflect.Message) { 26 | m.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { 27 | switch { 28 | // Handle singular message. 29 | case fd.Cardinality() != protoreflect.Repeated: 30 | if fd.Message() != nil { 31 | discardUnknown(m.Get(fd).Message()) 32 | } 33 | // Handle list of messages. 34 | case fd.IsList(): 35 | if fd.Message() != nil { 36 | ls := m.Get(fd).List() 37 | for i := 0; i < ls.Len(); i++ { 38 | discardUnknown(ls.Get(i).Message()) 39 | } 40 | } 41 | // Handle map of messages. 42 | case fd.IsMap(): 43 | if fd.MapValue().Message() != nil { 44 | ms := m.Get(fd).Map() 45 | ms.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { 46 | discardUnknown(v.Message()) 47 | return true 48 | }) 49 | } 50 | } 51 | return true 52 | }) 53 | 54 | // Discard unknown fields. 55 | if len(m.GetUnknown()) > 0 { 56 | m.SetUnknown(nil) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/wire.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | protoV2 "google.golang.org/protobuf/proto" 9 | "google.golang.org/protobuf/runtime/protoiface" 10 | ) 11 | 12 | // Size returns the size in bytes of the wire-format encoding of m. 13 | func Size(m Message) int { 14 | if m == nil { 15 | return 0 16 | } 17 | mi := MessageV2(m) 18 | return protoV2.Size(mi) 19 | } 20 | 21 | // Marshal returns the wire-format encoding of m. 22 | func Marshal(m Message) ([]byte, error) { 23 | b, err := marshalAppend(nil, m, false) 24 | if b == nil { 25 | b = zeroBytes 26 | } 27 | return b, err 28 | } 29 | 30 | var zeroBytes = make([]byte, 0, 0) 31 | 32 | func marshalAppend(buf []byte, m Message, deterministic bool) ([]byte, error) { 33 | if m == nil { 34 | return nil, ErrNil 35 | } 36 | mi := MessageV2(m) 37 | nbuf, err := protoV2.MarshalOptions{ 38 | Deterministic: deterministic, 39 | AllowPartial: true, 40 | }.MarshalAppend(buf, mi) 41 | if err != nil { 42 | return buf, err 43 | } 44 | if len(buf) == len(nbuf) { 45 | if !mi.ProtoReflect().IsValid() { 46 | return buf, ErrNil 47 | } 48 | } 49 | return nbuf, checkRequiredNotSet(mi) 50 | } 51 | 52 | // Unmarshal parses a wire-format message in b and places the decoded results in m. 53 | // 54 | // Unmarshal resets m before starting to unmarshal, so any existing data in m is always 55 | // removed. Use UnmarshalMerge to preserve and append to existing data. 56 | func Unmarshal(b []byte, m Message) error { 57 | m.Reset() 58 | return UnmarshalMerge(b, m) 59 | } 60 | 61 | // UnmarshalMerge parses a wire-format message in b and places the decoded results in m. 62 | func UnmarshalMerge(b []byte, m Message) error { 63 | mi := MessageV2(m) 64 | out, err := protoV2.UnmarshalOptions{ 65 | AllowPartial: true, 66 | Merge: true, 67 | }.UnmarshalState(protoiface.UnmarshalInput{ 68 | Buf: b, 69 | Message: mi.ProtoReflect(), 70 | }) 71 | if err != nil { 72 | return err 73 | } 74 | if out.Flags&protoiface.UnmarshalInitialized > 0 { 75 | return nil 76 | } 77 | return checkRequiredNotSet(mi) 78 | } 79 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/proto/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int stores v in a new int32 value and returns a pointer to it. 11 | // 12 | // Deprecated: Use Int32 instead. 13 | func Int(v int) *int32 { return Int32(int32(v)) } 14 | 15 | // Int32 stores v in a new int32 value and returns a pointer to it. 16 | func Int32(v int32) *int32 { return &v } 17 | 18 | // Int64 stores v in a new int64 value and returns a pointer to it. 19 | func Int64(v int64) *int64 { return &v } 20 | 21 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 22 | func Uint32(v uint32) *uint32 { return &v } 23 | 24 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 25 | func Uint64(v uint64) *uint64 { return &v } 26 | 27 | // Float32 stores v in a new float32 value and returns a pointer to it. 28 | func Float32(v float32) *float32 { return &v } 29 | 30 | // Float64 stores v in a new float64 value and returns a pointer to it. 31 | func Float64(v float64) *float64 { return &v } 32 | 33 | // String stores v in a new string value and returns a pointer to it. 34 | func String(v string) *string { return &v } 35 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of gorilla/mux authors for copyright purposes. 2 | # 3 | # Please keep the list sorted. 4 | 5 | Google LLC (https://opensource.google.com/) 6 | Kamil Kisielk 7 | Matt Silverlock 8 | Rodrigo Moraes (https://github.com/moraes) 9 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2018 The Gorilla Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gorilla/mux 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package mux 6 | 7 | import "net/http" 8 | 9 | // SetURLVars sets the URL variables for the given request, to be accessed via 10 | // mux.Vars for testing route behaviour. Arguments are not modified, a shallow 11 | // copy is returned. 12 | // 13 | // This API should only be used for testing purposes; it provides a way to 14 | // inject variables into the request context. Alternatively, URL variables 15 | // can be set by making a route that captures the required variables, 16 | // starting a server and sending the request to that server. 17 | func SetURLVars(r *http.Request, val map[string]string) *http.Request { 18 | return requestWithVars(r, val) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/README.md: -------------------------------------------------------------------------------- 1 | # cleanhttp 2 | 3 | Functions for accessing "clean" Go http.Client values 4 | 5 | ------------- 6 | 7 | The Go standard library contains a default `http.Client` called 8 | `http.DefaultClient`. It is a common idiom in Go code to start with 9 | `http.DefaultClient` and tweak it as necessary, and in fact, this is 10 | encouraged; from the `http` package documentation: 11 | 12 | > The Client's Transport typically has internal state (cached TCP connections), 13 | so Clients should be reused instead of created as needed. Clients are safe for 14 | concurrent use by multiple goroutines. 15 | 16 | Unfortunately, this is a shared value, and it is not uncommon for libraries to 17 | assume that they are free to modify it at will. With enough dependencies, it 18 | can be very easy to encounter strange problems and race conditions due to 19 | manipulation of this shared value across libraries and goroutines (clients are 20 | safe for concurrent use, but writing values to the client struct itself is not 21 | protected). 22 | 23 | Making things worse is the fact that a bare `http.Client` will use a default 24 | `http.Transport` called `http.DefaultTransport`, which is another global value 25 | that behaves the same way. So it is not simply enough to replace 26 | `http.DefaultClient` with `&http.Client{}`. 27 | 28 | This repository provides some simple functions to get a "clean" `http.Client` 29 | -- one that uses the same default values as the Go standard library, but 30 | returns a client that does not share any state with other clients. 31 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go: -------------------------------------------------------------------------------- 1 | package cleanhttp 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "runtime" 7 | "time" 8 | ) 9 | 10 | // DefaultTransport returns a new http.Transport with similar default values to 11 | // http.DefaultTransport, but with idle connections and keepalives disabled. 12 | func DefaultTransport() *http.Transport { 13 | transport := DefaultPooledTransport() 14 | transport.DisableKeepAlives = true 15 | transport.MaxIdleConnsPerHost = -1 16 | return transport 17 | } 18 | 19 | // DefaultPooledTransport returns a new http.Transport with similar default 20 | // values to http.DefaultTransport. Do not use this for transient transports as 21 | // it can leak file descriptors over time. Only use this for transports that 22 | // will be re-used for the same host(s). 23 | func DefaultPooledTransport() *http.Transport { 24 | transport := &http.Transport{ 25 | Proxy: http.ProxyFromEnvironment, 26 | DialContext: (&net.Dialer{ 27 | Timeout: 30 * time.Second, 28 | KeepAlive: 30 * time.Second, 29 | DualStack: true, 30 | }).DialContext, 31 | MaxIdleConns: 100, 32 | IdleConnTimeout: 90 * time.Second, 33 | TLSHandshakeTimeout: 10 * time.Second, 34 | ExpectContinueTimeout: 1 * time.Second, 35 | ForceAttemptHTTP2: true, 36 | MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, 37 | } 38 | return transport 39 | } 40 | 41 | // DefaultClient returns a new http.Client with similar default values to 42 | // http.Client, but with a non-shared Transport, idle connections disabled, and 43 | // keepalives disabled. 44 | func DefaultClient() *http.Client { 45 | return &http.Client{ 46 | Transport: DefaultTransport(), 47 | } 48 | } 49 | 50 | // DefaultPooledClient returns a new http.Client with similar default values to 51 | // http.Client, but with a shared Transport. Do not use this function for 52 | // transient clients as it can leak file descriptors over time. Only use this 53 | // for clients that will be re-used for the same host(s). 54 | func DefaultPooledClient() *http.Client { 55 | return &http.Client{ 56 | Transport: DefaultPooledTransport(), 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/doc.go: -------------------------------------------------------------------------------- 1 | // Package cleanhttp offers convenience utilities for acquiring "clean" 2 | // http.Transport and http.Client structs. 3 | // 4 | // Values set on http.DefaultClient and http.DefaultTransport affect all 5 | // callers. This can have detrimental effects, esepcially in TLS contexts, 6 | // where client or root certificates set to talk to multiple endpoints can end 7 | // up displacing each other, leading to hard-to-debug issues. This package 8 | // provides non-shared http.Client and http.Transport structs to ensure that 9 | // the configuration will not be overwritten by other parts of the application 10 | // or dependencies. 11 | // 12 | // The DefaultClient and DefaultTransport functions disable idle connections 13 | // and keepalives. Without ensuring that idle connections are closed before 14 | // garbage collection, short-term clients/transports can leak file descriptors, 15 | // eventually leading to "too many open files" errors. If you will be 16 | // connecting to the same hosts repeatedly from the same client, you can use 17 | // DefaultPooledClient to receive a client that has connection pooling 18 | // semantics similar to http.DefaultClient. 19 | // 20 | package cleanhttp 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/go-cleanhttp 2 | 3 | go 1.13 4 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/handlers.go: -------------------------------------------------------------------------------- 1 | package cleanhttp 2 | 3 | import ( 4 | "net/http" 5 | "strings" 6 | "unicode" 7 | ) 8 | 9 | // HandlerInput provides input options to cleanhttp's handlers 10 | type HandlerInput struct { 11 | ErrStatus int 12 | } 13 | 14 | // PrintablePathCheckHandler is a middleware that ensures the request path 15 | // contains only printable runes. 16 | func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler { 17 | // Nil-check on input to make it optional 18 | if input == nil { 19 | input = &HandlerInput{ 20 | ErrStatus: http.StatusBadRequest, 21 | } 22 | } 23 | 24 | // Default to http.StatusBadRequest on error 25 | if input.ErrStatus == 0 { 26 | input.ErrStatus = http.StatusBadRequest 27 | } 28 | 29 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 30 | if r != nil { 31 | // Check URL path for non-printable characters 32 | idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { 33 | return !unicode.IsPrint(c) 34 | }) 35 | 36 | if idx != -1 { 37 | w.WriteHeader(input.ErrStatus) 38 | return 39 | } 40 | 41 | if next != nil { 42 | next.ServeHTTP(w, r) 43 | } 44 | } 45 | 46 | return 47 | }) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Matous Dzivjak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | help: ## Show help/documentation for the Makefile 4 | @grep -Eh '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 5 | 6 | configure: ## Download dependencies 7 | go mod download 8 | 9 | lint: configure ## Lint the repository with golang-ci lint 10 | golangci-lint run --max-same-issues 0 --max-issues-per-linter 0 $(if $(CI),--out-format code-climate > gl-code-quality-report.json 2>golangci-stderr-output) 11 | 12 | test: configure ## Run all tests 13 | go test -v 14 | 15 | bench: configure ## Run all benchmarks 16 | go test -bench=. 17 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/README.md: -------------------------------------------------------------------------------- 1 | # Go Nanoid 2 | 3 | [![Build Status](https://github.com/matoous/go-nanoid/workflows/Tests/badge.svg)](https://github.com/matoous/go-nanoid/actions) 4 | [![Build Status](https://github.com/matoous/go-nanoid/workflows/Lint/badge.svg)](https://github.com/matoous/go-nanoid/actions) 5 | [![GoDoc](https://godoc.org/github.com/matoous/go-nanoid?status.svg)](https://godoc.org/github.com/matoous/go-nanoid) 6 | [![Go Report Card](https://goreportcard.com/badge/github.com/matoous/go-nanoid)](https://goreportcard.com/report/github.com/matoous/go-nanoid) 7 | [![GitHub issues](https://img.shields.io/github/issues/matoous/go-nanoid.svg)](https://github.com/matoous/go-nanoid/issues) 8 | [![License](https://img.shields.io/badge/license-MIT%20License-blue.svg)](https://github.com/matoous/go-nanoid/LICENSE) 9 | 10 | 11 | This package is Go implementation of [ai's](https://github.com/ai) [nanoid](https://github.com/ai/nanoid)! 12 | 13 | **Safe.** It uses cryptographically strong random generator. 14 | 15 | **Compact.** It uses more symbols than UUID (`A-Za-z0-9_-`) 16 | and has the same number of unique options in just 22 symbols instead of 36. 17 | 18 | **Fast.** Nanoid is as fast as UUID but can be used in URLs. 19 | 20 | ## Install 21 | 22 | Via go get tool 23 | 24 | ``` bash 25 | $ go get github.com/matoous/go-nanoid 26 | ``` 27 | 28 | ## Usage 29 | 30 | Generate ID 31 | 32 | ``` go 33 | id, err := gonanoid.New() 34 | ``` 35 | 36 | Generate ID with a custom alphabet and length 37 | 38 | ``` go 39 | id, err := gonanoid.Generate("abcde", 54) 40 | ``` 41 | 42 | ## Notice 43 | 44 | If you use Go Nanoid in your project, please let me know! 45 | 46 | If you have any issues, just feel free and open it in this repository, thanks! 47 | 48 | ## Credits 49 | 50 | - [ai](https://github.com/ai) - [nanoid](https://github.com/ai/nanoid) 51 | - icza - his tutorial on [random strings in Go](https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang) 52 | 53 | ## License 54 | 55 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 56 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/go.mod: -------------------------------------------------------------------------------- 1 | go 1.15 2 | 3 | module github.com/matoous/go-nanoid/v2 4 | 5 | require ( 6 | github.com/matoous/go-nanoid v1.5.0 7 | github.com/stretchr/testify v1.6.1 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/matoous/go-nanoid/v2/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/matoous/go-nanoid v1.5.0 h1:VRorl6uCngneC4oUQqOYtO3S0H5QKFtKuKycFG3euek= 4 | github.com/matoous/go-nanoid v1.5.0/go.mod h1:zyD2a71IubI24efhpvkJz+ZwfwagzgSO6UNiFsZKN7U= 5 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 6 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 7 | github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= 8 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 9 | github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 10 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 11 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 12 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 13 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 14 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 15 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/README.md: -------------------------------------------------------------------------------- 1 | # go-homedir 2 | 3 | This is a Go library for detecting the user's home directory without 4 | the use of cgo, so the library can be used in cross-compilation environments. 5 | 6 | Usage is incredibly simple, just call `homedir.Dir()` to get the home directory 7 | for a user, and `homedir.Expand()` to expand the `~` in a path to the home 8 | directory. 9 | 10 | **Why not just use `os/user`?** The built-in `os/user` package requires 11 | cgo on Darwin systems. This means that any Go code that uses that package 12 | cannot cross compile. But 99% of the time the use for `os/user` is just to 13 | retrieve the home directory, which we can do for the current user without 14 | cgo. This library does that, enabling cross-compilation. 15 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/go-homedir 2 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.11.x 5 | - 1.12.x 6 | - 1.13.x 7 | - tip 8 | 9 | script: 10 | - make check 11 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/Makefile: -------------------------------------------------------------------------------- 1 | PKGS := github.com/pkg/errors 2 | SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS)) 3 | GO := go 4 | 5 | check: test vet gofmt misspell unconvert staticcheck ineffassign unparam 6 | 7 | test: 8 | $(GO) test $(PKGS) 9 | 10 | vet: | test 11 | $(GO) vet $(PKGS) 12 | 13 | staticcheck: 14 | $(GO) get honnef.co/go/tools/cmd/staticcheck 15 | staticcheck -checks all $(PKGS) 16 | 17 | misspell: 18 | $(GO) get github.com/client9/misspell/cmd/misspell 19 | misspell \ 20 | -locale GB \ 21 | -error \ 22 | *.md *.go 23 | 24 | unconvert: 25 | $(GO) get github.com/mdempsky/unconvert 26 | unconvert -v $(PKGS) 27 | 28 | ineffassign: 29 | $(GO) get github.com/gordonklaus/ineffassign 30 | find $(SRCDIRS) -name '*.go' | xargs ineffassign 31 | 32 | pedantic: check errcheck 33 | 34 | unparam: 35 | $(GO) get mvdan.cc/unparam 36 | unparam ./... 37 | 38 | errcheck: 39 | $(GO) get github.com/kisielk/errcheck 40 | errcheck $(PKGS) 41 | 42 | gofmt: 43 | @echo Checking code is gofmted 44 | @test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)" 45 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/go113.go: -------------------------------------------------------------------------------- 1 | // +build go1.13 2 | 3 | package errors 4 | 5 | import ( 6 | stderrors "errors" 7 | ) 8 | 9 | // Is reports whether any error in err's chain matches target. 10 | // 11 | // The chain consists of err itself followed by the sequence of errors obtained by 12 | // repeatedly calling Unwrap. 13 | // 14 | // An error is considered to match a target if it is equal to that target or if 15 | // it implements a method Is(error) bool such that Is(target) returns true. 16 | func Is(err, target error) bool { return stderrors.Is(err, target) } 17 | 18 | // As finds the first error in err's chain that matches target, and if so, sets 19 | // target to that error value and returns true. 20 | // 21 | // The chain consists of err itself followed by the sequence of errors obtained by 22 | // repeatedly calling Unwrap. 23 | // 24 | // An error matches target if the error's concrete value is assignable to the value 25 | // pointed to by target, or if the error has a method As(interface{}) bool such that 26 | // As(target) returns true. In the latter case, the As method is responsible for 27 | // setting target. 28 | // 29 | // As will panic if target is not a non-nil pointer to either a type that implements 30 | // error, or to any interface type. As returns false if err is nil. 31 | func As(err error, target interface{}) bool { return stderrors.As(err, target) } 32 | 33 | // Unwrap returns the result of calling the Unwrap method on err, if err's 34 | // type contains an Unwrap method returning error. 35 | // Otherwise, Unwrap returns nil. 36 | func Unwrap(err error) error { 37 | return stderrors.Unwrap(err) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/planetscale/planetscale-go/planetscale/regions.go: -------------------------------------------------------------------------------- 1 | package planetscale 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | 7 | "github.com/pkg/errors" 8 | ) 9 | 10 | const regionsAPIPath = "v1/regions" 11 | 12 | type Region struct { 13 | Slug string `json:"slug"` 14 | Name string `json:"display_name"` 15 | Location string `json:"location"` 16 | Enabled bool `json:"enabled"` 17 | } 18 | 19 | type regionsResponse struct { 20 | Regions []*Region `json:"data"` 21 | } 22 | 23 | type ListRegionsRequest struct{} 24 | 25 | type RegionsService interface { 26 | List(ctx context.Context, req *ListRegionsRequest) ([]*Region, error) 27 | } 28 | 29 | type regionsService struct { 30 | client *Client 31 | } 32 | 33 | var _ RegionsService = ®ionsService{} 34 | 35 | func NewRegionsSevice(client *Client) *regionsService { 36 | return ®ionsService{ 37 | client: client, 38 | } 39 | } 40 | 41 | func (r *regionsService) List(ctx context.Context, listReq *ListRegionsRequest) ([]*Region, error) { 42 | req, err := r.client.newRequest(http.MethodGet, regionsAPIPath, nil) 43 | if err != nil { 44 | return nil, errors.Wrap(err, "error creating request for list regions") 45 | } 46 | 47 | regionsResponse := ®ionsResponse{} 48 | if err := r.client.do(ctx, req, ®ionsResponse); err != nil { 49 | return nil, err 50 | } 51 | 52 | return regionsResponse.Regions, nil 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/planetscale/sql-proxy/proxy/tls_cache.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "crypto/tls" 5 | "errors" 6 | "sync" 7 | "time" 8 | ) 9 | 10 | var errConfigNotFound = errors.New("TLS config not found") 11 | 12 | // expireTTL defines the time 13 | const expireTTL = 10 * time.Minute 14 | 15 | type cacheEntry struct { 16 | // cfg defines the TLS config we're caching 17 | cfg *tls.Config 18 | remoteAddr string 19 | 20 | // added holds the time the cfg was added to the cache 21 | added time.Time 22 | } 23 | 24 | type tlsCache struct { 25 | // configs holds the TLS config for each remote instance 26 | configs map[string]cacheEntry 27 | configsMu sync.Mutex // protects configs 28 | 29 | // nowFn returns the current local time, used during insertion of cache 30 | // entries. It's a function so we can use it for tests. 31 | nowFn func() time.Time 32 | } 33 | 34 | func newtlsCache() *tlsCache { 35 | return &tlsCache{ 36 | configs: make(map[string]cacheEntry), 37 | nowFn: time.Now, 38 | } 39 | } 40 | 41 | // Add adds the given config and remote address for the given instance name 42 | func (t *tlsCache) Add(instance string, cfg *tls.Config, remoteAddr string) { 43 | t.configsMu.Lock() 44 | defer t.configsMu.Unlock() 45 | 46 | t.configs[instance] = cacheEntry{ 47 | cfg: cfg, 48 | remoteAddr: remoteAddr, 49 | added: t.nowFn(), 50 | } 51 | } 52 | 53 | // Get retrieves the config for the given instance 54 | func (t *tlsCache) Get(instance string) (cacheEntry, error) { 55 | t.configsMu.Lock() 56 | defer t.configsMu.Unlock() 57 | 58 | e, ok := t.configs[instance] 59 | if !ok { 60 | return cacheEntry{}, errConfigNotFound 61 | } 62 | 63 | now := time.Now() 64 | 65 | // delete the config if it's expired. This will trigger the user to request 66 | // another TLS config. 67 | if e.added.Add(expireTTL).Before(now) { 68 | delete(t.configs, instance) 69 | return cacheEntry{}, errConfigNotFound 70 | } 71 | 72 | return e, nil 73 | } 74 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: 80..100 3 | round: down 4 | precision: 2 5 | 6 | status: 7 | project: # measuring the overall project coverage 8 | default: # context, you can create multiple ones with custom titles 9 | enabled: yes # must be yes|true to enable this status 10 | target: 100 # specify the target coverage for each commit status 11 | # option: "auto" (must increase from parent commit or pull request base) 12 | # option: "X%" a static target percentage to hit 13 | if_not_found: success # if parent is not found report status as success, error, or failure 14 | if_ci_failed: error # if ci fails report status as success, error, or failure 15 | 16 | # Also update COVER_IGNORE_PKGS in the Makefile. 17 | ignore: 18 | - /internal/gen-atomicint/ 19 | - /internal/gen-valuewrapper/ 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | .DS_Store 3 | /vendor 4 | cover.html 5 | cover.out 6 | lint.log 7 | 8 | # Binaries 9 | *.test 10 | 11 | # Profiling output 12 | *.prof 13 | 14 | # Output of fossa analyzer 15 | /fossa 16 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/README.md: -------------------------------------------------------------------------------- 1 | # atomic [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Go Report Card][reportcard-img]][reportcard] 2 | 3 | Simple wrappers for primitive types to enforce atomic access. 4 | 5 | ## Installation 6 | 7 | ```shell 8 | $ go get -u go.uber.org/atomic@v1 9 | ``` 10 | 11 | ### Legacy Import Path 12 | 13 | As of v1.5.0, the import path `go.uber.org/atomic` is the only supported way 14 | of using this package. If you are using Go modules, this package will fail to 15 | compile with the legacy import path path `github.com/uber-go/atomic`. 16 | 17 | We recommend migrating your code to the new import path but if you're unable 18 | to do so, or if your dependencies are still using the old import path, you 19 | will have to add a `replace` directive to your `go.mod` file downgrading the 20 | legacy import path to an older version. 21 | 22 | ``` 23 | replace github.com/uber-go/atomic => github.com/uber-go/atomic v1.4.0 24 | ``` 25 | 26 | You can do so automatically by running the following command. 27 | 28 | ```shell 29 | $ go mod edit -replace github.com/uber-go/atomic=github.com/uber-go/atomic@v1.4.0 30 | ``` 31 | 32 | ## Usage 33 | 34 | The standard library's `sync/atomic` is powerful, but it's easy to forget which 35 | variables must be accessed atomically. `go.uber.org/atomic` preserves all the 36 | functionality of the standard library, but wraps the primitive types to 37 | provide a safer, more convenient API. 38 | 39 | ```go 40 | var atom atomic.Uint32 41 | atom.Store(42) 42 | atom.Sub(2) 43 | atom.CAS(40, 11) 44 | ``` 45 | 46 | See the [documentation][doc] for a complete API specification. 47 | 48 | ## Development Status 49 | 50 | Stable. 51 | 52 | --- 53 | 54 | Released under the [MIT License](LICENSE.txt). 55 | 56 | [doc-img]: https://godoc.org/github.com/uber-go/atomic?status.svg 57 | [doc]: https://godoc.org/go.uber.org/atomic 58 | [ci-img]: https://github.com/uber-go/atomic/actions/workflows/go.yml/badge.svg 59 | [ci]: https://github.com/uber-go/atomic/actions/workflows/go.yml 60 | [cov-img]: https://codecov.io/gh/uber-go/atomic/branch/master/graph/badge.svg 61 | [cov]: https://codecov.io/gh/uber-go/atomic 62 | [reportcard-img]: https://goreportcard.com/badge/go.uber.org/atomic 63 | [reportcard]: https://goreportcard.com/report/go.uber.org/atomic 64 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/bool_ext.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | import ( 24 | "strconv" 25 | ) 26 | 27 | //go:generate bin/gen-atomicwrapper -name=Bool -type=bool -wrapped=Uint32 -pack=boolToInt -unpack=truthy -cas -swap -json -file=bool.go 28 | 29 | func truthy(n uint32) bool { 30 | return n == 1 31 | } 32 | 33 | func boolToInt(b bool) uint32 { 34 | if b { 35 | return 1 36 | } 37 | return 0 38 | } 39 | 40 | // Toggle atomically negates the Boolean and returns the previous value. 41 | func (b *Bool) Toggle() (old bool) { 42 | for { 43 | old := b.Load() 44 | if b.CAS(old, !old) { 45 | return old 46 | } 47 | } 48 | } 49 | 50 | // String encodes the wrapped value as a string. 51 | func (b *Bool) String() string { 52 | return strconv.FormatBool(b.Load()) 53 | } 54 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | // Package atomic provides simple wrappers around numerics to enforce atomic 22 | // access. 23 | package atomic 24 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/duration_ext.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | import "time" 24 | 25 | //go:generate bin/gen-atomicwrapper -name=Duration -type=time.Duration -wrapped=Int64 -pack=int64 -unpack=time.Duration -cas -swap -json -imports time -file=duration.go 26 | 27 | // Add atomically adds to the wrapped time.Duration and returns the new value. 28 | func (d *Duration) Add(delta time.Duration) time.Duration { 29 | return time.Duration(d.v.Add(int64(delta))) 30 | } 31 | 32 | // Sub atomically subtracts from the wrapped time.Duration and returns the new value. 33 | func (d *Duration) Sub(delta time.Duration) time.Duration { 34 | return time.Duration(d.v.Sub(int64(delta))) 35 | } 36 | 37 | // String encodes the wrapped value as a string. 38 | func (d *Duration) String() string { 39 | return d.Load().String() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/error.go: -------------------------------------------------------------------------------- 1 | // @generated Code generated by gen-atomicwrapper. 2 | 3 | // Copyright (c) 2020-2021 Uber Technologies, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | package atomic 24 | 25 | // Error is an atomic type-safe wrapper for error values. 26 | type Error struct { 27 | _ nocmp // disallow non-atomic comparison 28 | 29 | v Value 30 | } 31 | 32 | var _zeroError error 33 | 34 | // NewError creates a new Error. 35 | func NewError(val error) *Error { 36 | x := &Error{} 37 | if val != _zeroError { 38 | x.Store(val) 39 | } 40 | return x 41 | } 42 | 43 | // Load atomically loads the wrapped error. 44 | func (x *Error) Load() error { 45 | return unpackError(x.v.Load()) 46 | } 47 | 48 | // Store atomically stores the passed error. 49 | func (x *Error) Store(val error) { 50 | x.v.Store(packError(val)) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/error_ext.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | // atomic.Value panics on nil inputs, or if the underlying type changes. 24 | // Stabilize by always storing a custom struct that we control. 25 | 26 | //go:generate bin/gen-atomicwrapper -name=Error -type=error -wrapped=Value -pack=packError -unpack=unpackError -file=error.go 27 | 28 | type packedError struct{ Value error } 29 | 30 | func packError(v error) interface{} { 31 | return packedError{v} 32 | } 33 | 34 | func unpackError(v interface{}) error { 35 | if err, ok := v.(packedError); ok { 36 | return err.Value 37 | } 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/gen.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | //go:generate bin/gen-atomicint -name=Int32 -wrapped=int32 -file=int32.go 24 | //go:generate bin/gen-atomicint -name=Int64 -wrapped=int64 -file=int64.go 25 | //go:generate bin/gen-atomicint -name=Uint32 -wrapped=uint32 -unsigned -file=uint32.go 26 | //go:generate bin/gen-atomicint -name=Uint64 -wrapped=uint64 -unsigned -file=uint64.go 27 | //go:generate bin/gen-atomicint -name=Uintptr -wrapped=uintptr -unsigned -file=uintptr.go 28 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/go.mod: -------------------------------------------------------------------------------- 1 | module go.uber.org/atomic 2 | 3 | require ( 4 | github.com/davecgh/go-spew v1.1.1 // indirect 5 | github.com/stretchr/testify v1.3.0 6 | ) 7 | 8 | go 1.13 9 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 5 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 6 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 7 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 8 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 9 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/nocmp.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | // nocmp is an uncomparable struct. Embed this inside another struct to make 24 | // it uncomparable. 25 | // 26 | // type Foo struct { 27 | // nocmp 28 | // // ... 29 | // } 30 | // 31 | // This DOES NOT: 32 | // 33 | // - Disallow shallow copies of structs 34 | // - Disallow comparison of pointers to uncomparable structs 35 | type nocmp [0]func() 36 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/string.go: -------------------------------------------------------------------------------- 1 | // @generated Code generated by gen-atomicwrapper. 2 | 3 | // Copyright (c) 2020-2021 Uber Technologies, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | package atomic 24 | 25 | // String is an atomic type-safe wrapper for string values. 26 | type String struct { 27 | _ nocmp // disallow non-atomic comparison 28 | 29 | v Value 30 | } 31 | 32 | var _zeroString string 33 | 34 | // NewString creates a new String. 35 | func NewString(val string) *String { 36 | x := &String{} 37 | if val != _zeroString { 38 | x.Store(val) 39 | } 40 | return x 41 | } 42 | 43 | // Load atomically loads the wrapped string. 44 | func (x *String) Load() string { 45 | if v := x.v.Load(); v != nil { 46 | return v.(string) 47 | } 48 | return _zeroString 49 | } 50 | 51 | // Store atomically stores the passed string. 52 | func (x *String) Store(val string) { 53 | x.v.Store(val) 54 | } 55 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/string_ext.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | //go:generate bin/gen-atomicwrapper -name=String -type=string -wrapped=Value -file=string.go 24 | // Note: No Swap as String wraps Value, which wraps the stdlib sync/atomic.Value which 25 | // only supports Swap as of go1.17: https://github.com/golang/go/issues/39351 26 | 27 | // String returns the wrapped value. 28 | func (s *String) String() string { 29 | return s.Load() 30 | } 31 | 32 | // MarshalText encodes the wrapped string into a textual form. 33 | // 34 | // This makes it encodable as JSON, YAML, XML, and more. 35 | func (s *String) MarshalText() ([]byte, error) { 36 | return []byte(s.Load()), nil 37 | } 38 | 39 | // UnmarshalText decodes text and replaces the wrapped string with it. 40 | // 41 | // This makes it decodable from JSON, YAML, XML, and more. 42 | func (s *String) UnmarshalText(b []byte) error { 43 | s.Store(string(b)) 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/time.go: -------------------------------------------------------------------------------- 1 | // @generated Code generated by gen-atomicwrapper. 2 | 3 | // Copyright (c) 2020-2021 Uber Technologies, Inc. 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | package atomic 24 | 25 | import ( 26 | "time" 27 | ) 28 | 29 | // Time is an atomic type-safe wrapper for time.Time values. 30 | type Time struct { 31 | _ nocmp // disallow non-atomic comparison 32 | 33 | v Value 34 | } 35 | 36 | var _zeroTime time.Time 37 | 38 | // NewTime creates a new Time. 39 | func NewTime(val time.Time) *Time { 40 | x := &Time{} 41 | if val != _zeroTime { 42 | x.Store(val) 43 | } 44 | return x 45 | } 46 | 47 | // Load atomically loads the wrapped time.Time. 48 | func (x *Time) Load() time.Time { 49 | return unpackTime(x.v.Load()) 50 | } 51 | 52 | // Store atomically stores the passed time.Time. 53 | func (x *Time) Store(val time.Time) { 54 | x.v.Store(packTime(val)) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/time_ext.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | import "time" 24 | 25 | //go:generate bin/gen-atomicwrapper -name=Time -type=time.Time -wrapped=Value -pack=packTime -unpack=unpackTime -imports time -file=time.go 26 | 27 | func packTime(t time.Time) interface{} { 28 | return t 29 | } 30 | 31 | func unpackTime(v interface{}) time.Time { 32 | if t, ok := v.(time.Time); ok { 33 | return t 34 | } 35 | return time.Time{} 36 | } 37 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/unsafe_pointer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | import ( 24 | "sync/atomic" 25 | "unsafe" 26 | ) 27 | 28 | // UnsafePointer is an atomic wrapper around unsafe.Pointer. 29 | type UnsafePointer struct { 30 | _ nocmp // disallow non-atomic comparison 31 | 32 | v unsafe.Pointer 33 | } 34 | 35 | // NewUnsafePointer creates a new UnsafePointer. 36 | func NewUnsafePointer(val unsafe.Pointer) *UnsafePointer { 37 | return &UnsafePointer{v: val} 38 | } 39 | 40 | // Load atomically loads the wrapped value. 41 | func (p *UnsafePointer) Load() unsafe.Pointer { 42 | return atomic.LoadPointer(&p.v) 43 | } 44 | 45 | // Store atomically stores the passed value. 46 | func (p *UnsafePointer) Store(val unsafe.Pointer) { 47 | atomic.StorePointer(&p.v, val) 48 | } 49 | 50 | // Swap atomically swaps the wrapped unsafe.Pointer and returns the old value. 51 | func (p *UnsafePointer) Swap(val unsafe.Pointer) (old unsafe.Pointer) { 52 | return atomic.SwapPointer(&p.v, val) 53 | } 54 | 55 | // CAS is an atomic compare-and-swap. 56 | func (p *UnsafePointer) CAS(old, new unsafe.Pointer) (swapped bool) { 57 | return atomic.CompareAndSwapPointer(&p.v, old, new) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/value.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package atomic 22 | 23 | import "sync/atomic" 24 | 25 | // Value shadows the type of the same name from sync/atomic 26 | // https://godoc.org/sync/atomic#Value 27 | type Value struct { 28 | atomic.Value 29 | 30 | _ nocmp // disallow non-atomic comparison 31 | } 32 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: 80..100 3 | round: down 4 | precision: 2 5 | 6 | status: 7 | project: # measuring the overall project coverage 8 | default: # context, you can create multiple ones with custom titles 9 | enabled: yes # must be yes|true to enable this status 10 | target: 100 # specify the target coverage for each commit status 11 | # option: "auto" (must increase from parent commit or pull request base) 12 | # option: "X%" a static target percentage to hit 13 | if_not_found: success # if parent is not found report status as success, error, or failure 14 | if_ci_failed: error # if ci fails report status as success, error, or failure 15 | 16 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | cover.html 3 | cover.out 4 | /bin 5 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Releases 2 | ======== 3 | 4 | v1.8.0 (2022-02-28) 5 | =================== 6 | 7 | - `Combine`: perform zero allocations when there are no errors. 8 | 9 | 10 | v1.7.0 (2021-05-06) 11 | =================== 12 | 13 | - Add `AppendInvoke` to append into errors from `defer` blocks. 14 | 15 | 16 | v1.6.0 (2020-09-14) 17 | =================== 18 | 19 | - Actually drop library dependency on development-time tooling. 20 | 21 | 22 | v1.5.0 (2020-02-24) 23 | =================== 24 | 25 | - Drop library dependency on development-time tooling. 26 | 27 | 28 | v1.4.0 (2019-11-04) 29 | =================== 30 | 31 | - Add `AppendInto` function to more ergonomically build errors inside a 32 | loop. 33 | 34 | 35 | v1.3.0 (2019-10-29) 36 | =================== 37 | 38 | - Switch to Go modules. 39 | 40 | 41 | v1.2.0 (2019-09-26) 42 | =================== 43 | 44 | - Support extracting and matching against wrapped errors with `errors.As` 45 | and `errors.Is`. 46 | 47 | 48 | v1.1.0 (2017-06-30) 49 | =================== 50 | 51 | - Added an `Errors(error) []error` function to extract the underlying list of 52 | errors for a multierr error. 53 | 54 | 55 | v1.0.0 (2017-05-31) 56 | =================== 57 | 58 | No changes since v0.2.0. This release is committing to making no breaking 59 | changes to the current API in the 1.X series. 60 | 61 | 62 | v0.2.0 (2017-04-11) 63 | =================== 64 | 65 | - Repeatedly appending to the same error is now faster due to fewer 66 | allocations. 67 | 68 | 69 | v0.1.0 (2017-31-03) 70 | =================== 71 | 72 | - Initial release 73 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2021 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/Makefile: -------------------------------------------------------------------------------- 1 | # Directory to put `go install`ed binaries in. 2 | export GOBIN ?= $(shell pwd)/bin 3 | 4 | GO_FILES := $(shell \ 5 | find . '(' -path '*/.*' -o -path './vendor' ')' -prune \ 6 | -o -name '*.go' -print | cut -b3-) 7 | 8 | .PHONY: build 9 | build: 10 | go build ./... 11 | 12 | .PHONY: test 13 | test: 14 | go test -race ./... 15 | 16 | .PHONY: gofmt 17 | gofmt: 18 | $(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX)) 19 | @gofmt -e -s -l $(GO_FILES) > $(FMT_LOG) || true 20 | @[ ! -s "$(FMT_LOG)" ] || (echo "gofmt failed:" | cat - $(FMT_LOG) && false) 21 | 22 | .PHONY: golint 23 | golint: 24 | @cd tools && go install golang.org/x/lint/golint 25 | @$(GOBIN)/golint ./... 26 | 27 | .PHONY: staticcheck 28 | staticcheck: 29 | @cd tools && go install honnef.co/go/tools/cmd/staticcheck 30 | @$(GOBIN)/staticcheck ./... 31 | 32 | .PHONY: lint 33 | lint: gofmt golint staticcheck 34 | 35 | .PHONY: cover 36 | cover: 37 | go test -race -coverprofile=cover.out -coverpkg=./... -v ./... 38 | go tool cover -html=cover.out -o cover.html 39 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/README.md: -------------------------------------------------------------------------------- 1 | # multierr [![GoDoc][doc-img]][doc] [![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] 2 | 3 | `multierr` allows combining one or more Go `error`s together. 4 | 5 | ## Installation 6 | 7 | go get -u go.uber.org/multierr 8 | 9 | ## Status 10 | 11 | Stable: No breaking changes will be made before 2.0. 12 | 13 | ------------------------------------------------------------------------------- 14 | 15 | Released under the [MIT License]. 16 | 17 | [MIT License]: LICENSE.txt 18 | [doc-img]: https://pkg.go.dev/badge/go.uber.org/multierr 19 | [doc]: https://pkg.go.dev/go.uber.org/multierr 20 | [ci-img]: https://github.com/uber-go/multierr/actions/workflows/go.yml/badge.svg 21 | [cov-img]: https://codecov.io/gh/uber-go/multierr/branch/master/graph/badge.svg 22 | [ci]: https://github.com/uber-go/multierr/actions/workflows/go.yml 23 | [cov]: https://codecov.io/gh/uber-go/multierr 24 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/glide.yaml: -------------------------------------------------------------------------------- 1 | package: go.uber.org/multierr 2 | import: 3 | - package: go.uber.org/atomic 4 | version: ^1 5 | testImport: 6 | - package: github.com/stretchr/testify 7 | subpackages: 8 | - assert 9 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/go.mod: -------------------------------------------------------------------------------- 1 | module go.uber.org/multierr 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/stretchr/testify v1.7.0 7 | go.uber.org/atomic v1.7.0 8 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 5 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 6 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 7 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 8 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 9 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 10 | go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= 11 | go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= 12 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 13 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 14 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 15 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= 16 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 17 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: 80..100 3 | round: down 4 | precision: 2 5 | 6 | status: 7 | project: # measuring the overall project coverage 8 | default: # context, you can create multiple ones with custom titles 9 | enabled: yes # must be yes|true to enable this status 10 | target: 95% # specify the target coverage for each commit status 11 | # option: "auto" (must increase from parent commit or pull request base) 12 | # option: "X%" a static target percentage to hit 13 | if_not_found: success # if parent is not found report status as success, error, or failure 14 | if_ci_failed: error # if ci fails report status as success, error, or failure 15 | ignore: 16 | - internal/readme/readme.go 17 | 18 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | vendor 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | *.pprof 27 | *.out 28 | *.log 29 | 30 | /bin 31 | cover.out 32 | cover.html 33 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/buffer/pool.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package buffer 22 | 23 | import "sync" 24 | 25 | // A Pool is a type-safe wrapper around a sync.Pool. 26 | type Pool struct { 27 | p *sync.Pool 28 | } 29 | 30 | // NewPool constructs a new Pool. 31 | func NewPool() Pool { 32 | return Pool{p: &sync.Pool{ 33 | New: func() interface{} { 34 | return &Buffer{bs: make([]byte, 0, _size)} 35 | }, 36 | }} 37 | } 38 | 39 | // Get retrieves a Buffer from the pool, creating one if necessary. 40 | func (p Pool) Get() *Buffer { 41 | buf := p.p.Get().(*Buffer) 42 | buf.Reset() 43 | buf.pool = p 44 | return buf 45 | } 46 | 47 | func (p Pool) put(buf *Buffer) { 48 | p.p.Put(buf) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/checklicense.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | ERROR_COUNT=0 4 | while read -r file 5 | do 6 | case "$(head -1 "${file}")" in 7 | *"Copyright (c) "*" Uber Technologies, Inc.") 8 | # everything's cool 9 | ;; 10 | *) 11 | echo "$file is missing license header." 12 | (( ERROR_COUNT++ )) 13 | ;; 14 | esac 15 | done < <(git ls-files "*\.go") 16 | 17 | exit $ERROR_COUNT 18 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/flag.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zap 22 | 23 | import ( 24 | "flag" 25 | 26 | "go.uber.org/zap/zapcore" 27 | ) 28 | 29 | // LevelFlag uses the standard library's flag.Var to declare a global flag 30 | // with the specified name, default, and usage guidance. The returned value is 31 | // a pointer to the value of the flag. 32 | // 33 | // If you don't want to use the flag package's global state, you can use any 34 | // non-nil *Level as a flag.Value with your own *flag.FlagSet. 35 | func LevelFlag(name string, defaultLevel zapcore.Level, usage string) *zapcore.Level { 36 | lvl := defaultLevel 37 | flag.Var(&lvl, name, usage) 38 | return &lvl 39 | } 40 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/glide.yaml: -------------------------------------------------------------------------------- 1 | package: go.uber.org/zap 2 | license: MIT 3 | import: 4 | - package: go.uber.org/atomic 5 | version: ^1 6 | - package: go.uber.org/multierr 7 | version: ^1 8 | testImport: 9 | - package: github.com/satori/go.uuid 10 | - package: github.com/sirupsen/logrus 11 | - package: github.com/apex/log 12 | subpackages: 13 | - handlers/json 14 | - package: github.com/go-kit/kit 15 | subpackages: 16 | - log 17 | - package: github.com/stretchr/testify 18 | subpackages: 19 | - assert 20 | - require 21 | - package: gopkg.in/inconshreveable/log15.v2 22 | - package: github.com/mattn/goveralls 23 | - package: github.com/pborman/uuid 24 | - package: github.com/pkg/errors 25 | - package: github.com/rs/zerolog 26 | - package: golang.org/x/tools 27 | subpackages: 28 | - cover 29 | - package: golang.org/x/lint 30 | subpackages: 31 | - golint 32 | - package: github.com/axw/gocov 33 | subpackages: 34 | - gocov 35 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/go.mod: -------------------------------------------------------------------------------- 1 | module go.uber.org/zap 2 | 3 | go 1.13 4 | 5 | require ( 6 | github.com/benbjohnson/clock v1.1.0 7 | github.com/pkg/errors v0.8.1 8 | github.com/stretchr/testify v1.7.0 9 | go.uber.org/atomic v1.7.0 10 | go.uber.org/goleak v1.1.11 11 | go.uber.org/multierr v1.6.0 12 | gopkg.in/yaml.v2 v2.2.8 13 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | // Package bufferpool houses zap's shared internal buffer pool. Third-party 22 | // packages can recreate the same functionality with buffers.NewPool. 23 | package bufferpool 24 | 25 | import "go.uber.org/zap/buffer" 26 | 27 | var ( 28 | _pool = buffer.NewPool() 29 | // Get retrieves a buffer from the pool, creating one if necessary. 30 | Get = _pool.Get 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/internal/color/color.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | // Package color adds coloring functionality for TTY output. 22 | package color 23 | 24 | import "fmt" 25 | 26 | // Foreground colors. 27 | const ( 28 | Black Color = iota + 30 29 | Red 30 | Green 31 | Yellow 32 | Blue 33 | Magenta 34 | Cyan 35 | White 36 | ) 37 | 38 | // Color represents a text color. 39 | type Color uint8 40 | 41 | // Add adds the coloring to the given string. 42 | func (c Color) Add(s string) string { 43 | return fmt.Sprintf("\x1b[%dm%s\x1b[0m", uint8(c), s) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/internal/exit/exit.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | // Package exit provides stubs so that unit tests can exercise code that calls 22 | // os.Exit(1). 23 | package exit 24 | 25 | import "os" 26 | 27 | var real = func() { os.Exit(1) } 28 | 29 | // Exit normally terminates the process by calling os.Exit(1). If the package 30 | // is stubbed, it instead records a call in the testing spy. 31 | func Exit() { 32 | real() 33 | } 34 | 35 | // A StubbedExit is a testing fake for os.Exit. 36 | type StubbedExit struct { 37 | Exited bool 38 | prev func() 39 | } 40 | 41 | // Stub substitutes a fake for the call to os.Exit(1). 42 | func Stub() *StubbedExit { 43 | s := &StubbedExit{prev: real} 44 | real = s.exit 45 | return s 46 | } 47 | 48 | // WithStub runs the supplied function with Exit stubbed. It returns the stub 49 | // used, so that users can test whether the process would have crashed. 50 | func WithStub(f func()) *StubbedExit { 51 | s := Stub() 52 | defer s.Unstub() 53 | f() 54 | return s 55 | } 56 | 57 | // Unstub restores the previous exit function. 58 | func (se *StubbedExit) Unstub() { 59 | real = se.prev 60 | } 61 | 62 | func (se *StubbedExit) exit() { 63 | se.Exited = true 64 | } 65 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/time.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zap 22 | 23 | import "time" 24 | 25 | func timeToMillis(t time.Time) int64 { 26 | return t.UnixNano() / int64(time.Millisecond) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/zapcore/clock.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zapcore 22 | 23 | import "time" 24 | 25 | // DefaultClock is the default clock used by Zap in operations that require 26 | // time. This clock uses the system clock for all operations. 27 | var DefaultClock = systemClock{} 28 | 29 | // Clock is a source of time for logged entries. 30 | type Clock interface { 31 | // Now returns the current local time. 32 | Now() time.Time 33 | 34 | // NewTicker returns *time.Ticker that holds a channel 35 | // that delivers "ticks" of a clock. 36 | NewTicker(time.Duration) *time.Ticker 37 | } 38 | 39 | // systemClock implements default Clock that uses system time. 40 | type systemClock struct{} 41 | 42 | func (systemClock) Now() time.Time { 43 | return time.Now() 44 | } 45 | 46 | func (systemClock) NewTicker(duration time.Duration) *time.Ticker { 47 | return time.NewTicker(duration) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/zapcore/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | // Package zapcore defines and implements the low-level interfaces upon which 22 | // zap is built. By providing alternate implementations of these interfaces, 23 | // external packages can extend zap's capabilities. 24 | package zapcore // import "go.uber.org/zap/zapcore" 25 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/zapcore/level_strings.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zapcore 22 | 23 | import "go.uber.org/zap/internal/color" 24 | 25 | var ( 26 | _levelToColor = map[Level]color.Color{ 27 | DebugLevel: color.Magenta, 28 | InfoLevel: color.Blue, 29 | WarnLevel: color.Yellow, 30 | ErrorLevel: color.Red, 31 | DPanicLevel: color.Red, 32 | PanicLevel: color.Red, 33 | FatalLevel: color.Red, 34 | } 35 | _unknownLevelColor = color.Red 36 | 37 | _levelToLowercaseColorString = make(map[Level]string, len(_levelToColor)) 38 | _levelToCapitalColorString = make(map[Level]string, len(_levelToColor)) 39 | ) 40 | 41 | func init() { 42 | for level, color := range _levelToColor { 43 | _levelToLowercaseColorString[level] = color.Add(level.String()) 44 | _levelToCapitalColorString[level] = color.Add(level.CapitalString()) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/zapcore/reflected_encoder.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zapcore 22 | 23 | import ( 24 | "encoding/json" 25 | "io" 26 | ) 27 | 28 | // ReflectedEncoder serializes log fields that can't be serialized with Zap's 29 | // JSON encoder. These have the ReflectType field type. 30 | // Use EncoderConfig.NewReflectedEncoder to set this. 31 | type ReflectedEncoder interface { 32 | // Encode encodes and writes to the underlying data stream. 33 | Encode(interface{}) error 34 | } 35 | 36 | func defaultReflectedEncoder(w io.Writer) ReflectedEncoder { 37 | enc := json.NewEncoder(w) 38 | // For consistency with our custom JSON encoder. 39 | enc.SetEscapeHTML(false) 40 | return enc 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.9 6 | // +build go1.9 7 | 8 | package context 9 | 10 | import "context" // standard library's context, as of Go 1.7 11 | 12 | // A Context carries a deadline, a cancelation signal, and other values across 13 | // API boundaries. 14 | // 15 | // Context's methods may be called by multiple goroutines simultaneously. 16 | type Context = context.Context 17 | 18 | // A CancelFunc tells an operation to abandon its work. 19 | // A CancelFunc does not wait for the work to stop. 20 | // After the first call, subsequent calls to a CancelFunc do nothing. 21 | type CancelFunc = context.CancelFunc 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | 6 | install: 7 | - export GOPATH="$HOME/gopath" 8 | - mkdir -p "$GOPATH/src/golang.org/x" 9 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 10 | - go get -v -t -d golang.org/x/oauth2/... 11 | 12 | script: 13 | - go test -v golang.org/x/oauth2/... 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/README.md: -------------------------------------------------------------------------------- 1 | # OAuth2 for Go 2 | 3 | [![Go Reference](https://pkg.go.dev/badge/golang.org/x/oauth2.svg)](https://pkg.go.dev/golang.org/x/oauth2) 4 | [![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) 5 | 6 | oauth2 package contains a client implementation for OAuth 2.0 spec. 7 | 8 | ## Installation 9 | 10 | ~~~~ 11 | go get golang.org/x/oauth2 12 | ~~~~ 13 | 14 | Or you can manually git clone the repository to 15 | `$(go env GOPATH)/src/golang.org/x/oauth2`. 16 | 17 | See pkg.go.dev for further documentation and examples. 18 | 19 | * [pkg.go.dev/golang.org/x/oauth2](https://pkg.go.dev/golang.org/x/oauth2) 20 | * [pkg.go.dev/golang.org/x/oauth2/google](https://pkg.go.dev/golang.org/x/oauth2/google) 21 | 22 | ## Policy for new packages 23 | 24 | We no longer accept new provider-specific packages in this repo if all 25 | they do is add a single endpoint variable. If you just want to add a 26 | single endpoint, add it to the 27 | [pkg.go.dev/golang.org/x/oauth2/endpoints](https://pkg.go.dev/golang.org/x/oauth2/endpoints) 28 | package. 29 | 30 | ## Report Issues / Send Patches 31 | 32 | This repository uses Gerrit for code changes. To learn how to submit changes to 33 | this repository, see https://golang.org/doc/contribute.html. 34 | 35 | The main issue tracker for the oauth2 repository is located at 36 | https://github.com/golang/oauth2/issues. 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/go.mod: -------------------------------------------------------------------------------- 1 | module golang.org/x/oauth2 2 | 3 | go 1.15 4 | 5 | require ( 6 | cloud.google.com/go v0.65.0 7 | golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd 8 | google.golang.org/appengine v1.6.6 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build appengine 6 | // +build appengine 7 | 8 | package internal 9 | 10 | import "google.golang.org/appengine/urlfetch" 11 | 12 | func init() { 13 | appengineClientHook = urlfetch.Client 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/oauth2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "crypto/rsa" 9 | "crypto/x509" 10 | "encoding/pem" 11 | "errors" 12 | "fmt" 13 | ) 14 | 15 | // ParseKey converts the binary contents of a private key file 16 | // to an *rsa.PrivateKey. It detects whether the private key is in a 17 | // PEM container or not. If so, it extracts the the private key 18 | // from PEM container before conversion. It only supports PEM 19 | // containers with no passphrase. 20 | func ParseKey(key []byte) (*rsa.PrivateKey, error) { 21 | block, _ := pem.Decode(key) 22 | if block != nil { 23 | key = block.Bytes 24 | } 25 | parsedKey, err := x509.ParsePKCS8PrivateKey(key) 26 | if err != nil { 27 | parsedKey, err = x509.ParsePKCS1PrivateKey(key) 28 | if err != nil { 29 | return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8; parse error: %v", err) 30 | } 31 | } 32 | parsed, ok := parsedKey.(*rsa.PrivateKey) 33 | if !ok { 34 | return nil, errors.New("private key is invalid") 35 | } 36 | return parsed, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/oauth2/internal/transport.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "context" 9 | "net/http" 10 | ) 11 | 12 | // HTTPClient is the context key to use with golang.org/x/net/context's 13 | // WithValue function to associate an *http.Client value with a context. 14 | var HTTPClient ContextKey 15 | 16 | // ContextKey is just an empty struct. It exists so HTTPClient can be 17 | // an immutable public variable with a unique type. It's immutable 18 | // because nobody else can create a ContextKey, being unexported. 19 | type ContextKey struct{} 20 | 21 | var appengineClientHook func(context.Context) *http.Client 22 | 23 | func ContextClient(ctx context.Context) *http.Client { 24 | if ctx != nil { 25 | if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { 26 | return hc 27 | } 28 | } 29 | if appengineClientHook != nil { 30 | return appengineClientHook(ctx) 31 | } 32 | return http.DefaultClient 33 | } 34 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/app_id.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | func parseFullAppID(appid string) (partition, domain, displayID string) { 12 | if i := strings.Index(appid, "~"); i != -1 { 13 | partition, appid = appid[:i], appid[i+1:] 14 | } 15 | if i := strings.Index(appid, ":"); i != -1 { 16 | domain, appid = appid[:i], appid[i+1:] 17 | } 18 | return partition, domain, appid 19 | } 20 | 21 | // appID returns "appid" or "domain.com:appid". 22 | func appID(fullAppID string) string { 23 | _, dom, dis := parseFullAppID(fullAppID) 24 | if dom != "" { 25 | return dom + ":" + dis 26 | } 27 | return dis 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/base/api_base.proto: -------------------------------------------------------------------------------- 1 | // Built-in base types for API calls. Primarily useful as return types. 2 | 3 | syntax = "proto2"; 4 | option go_package = "base"; 5 | 6 | package appengine.base; 7 | 8 | message StringProto { 9 | required string value = 1; 10 | } 11 | 12 | message Integer32Proto { 13 | required int32 value = 1; 14 | } 15 | 16 | message Integer64Proto { 17 | required int64 value = 1; 18 | } 19 | 20 | message BoolProto { 21 | required bool value = 1; 22 | } 23 | 24 | message DoubleProto { 25 | required double value = 1; 26 | } 27 | 28 | message BytesProto { 29 | required bytes value = 1 [ctype=CORD]; 30 | } 31 | 32 | message VoidProto { 33 | } 34 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "os" 9 | 10 | netcontext "golang.org/x/net/context" 11 | ) 12 | 13 | var ( 14 | // This is set to true in identity_classic.go, which is behind the appengine build tag. 15 | // The appengine build tag is set for the first generation runtimes (<= Go 1.9) but not 16 | // the second generation runtimes (>= Go 1.11), so this indicates whether we're on a 17 | // first-gen runtime. See IsStandard below for the second-gen check. 18 | appengineStandard bool 19 | 20 | // This is set to true in identity_flex.go, which is behind the appenginevm build tag. 21 | appengineFlex bool 22 | ) 23 | 24 | // AppID is the implementation of the wrapper function of the same name in 25 | // ../identity.go. See that file for commentary. 26 | func AppID(c netcontext.Context) string { 27 | return appID(FullyQualifiedAppID(c)) 28 | } 29 | 30 | // IsStandard is the implementation of the wrapper function of the same name in 31 | // ../appengine.go. See that file for commentary. 32 | func IsStandard() bool { 33 | // appengineStandard will be true for first-gen runtimes (<= Go 1.9) but not 34 | // second-gen (>= Go 1.11). 35 | return appengineStandard || IsSecondGen() 36 | } 37 | 38 | // IsStandard is the implementation of the wrapper function of the same name in 39 | // ../appengine.go. See that file for commentary. 40 | func IsSecondGen() bool { 41 | // Second-gen runtimes set $GAE_ENV so we use that to check if we're on a second-gen runtime. 42 | return os.Getenv("GAE_ENV") == "standard" 43 | } 44 | 45 | // IsFlex is the implementation of the wrapper function of the same name in 46 | // ../appengine.go. See that file for commentary. 47 | func IsFlex() bool { 48 | return appengineFlex 49 | } 50 | 51 | // IsAppEngine is the implementation of the wrapper function of the same name in 52 | // ../appengine.go. See that file for commentary. 53 | func IsAppEngine() bool { 54 | return IsStandard() || IsFlex() 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine" 11 | 12 | netcontext "golang.org/x/net/context" 13 | ) 14 | 15 | func init() { 16 | appengineStandard = true 17 | } 18 | 19 | func DefaultVersionHostname(ctx netcontext.Context) string { 20 | c := fromContext(ctx) 21 | if c == nil { 22 | panic(errNotAppEngineContext) 23 | } 24 | return appengine.DefaultVersionHostname(c) 25 | } 26 | 27 | func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() } 28 | func ServerSoftware() string { return appengine.ServerSoftware() } 29 | func InstanceID() string { return appengine.InstanceID() } 30 | func IsDevAppServer() bool { return appengine.IsDevAppServer() } 31 | 32 | func RequestID(ctx netcontext.Context) string { 33 | c := fromContext(ctx) 34 | if c == nil { 35 | panic(errNotAppEngineContext) 36 | } 37 | return appengine.RequestID(c) 38 | } 39 | 40 | func ModuleName(ctx netcontext.Context) string { 41 | c := fromContext(ctx) 42 | if c == nil { 43 | panic(errNotAppEngineContext) 44 | } 45 | return appengine.ModuleName(c) 46 | } 47 | func VersionID(ctx netcontext.Context) string { 48 | c := fromContext(ctx) 49 | if c == nil { 50 | panic(errNotAppEngineContext) 51 | } 52 | return appengine.VersionID(c) 53 | } 54 | 55 | func fullyQualifiedAppID(ctx netcontext.Context) string { 56 | c := fromContext(ctx) 57 | if c == nil { 58 | panic(errNotAppEngineContext) 59 | } 60 | return c.FullyQualifiedAppID() 61 | } 62 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/identity_flex.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appenginevm 6 | 7 | package internal 8 | 9 | func init() { 10 | appengineFlex = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "appengine_internal" 11 | ) 12 | 13 | func Main() { 14 | MainPath = "" 15 | appengine_internal.Main() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main_common.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // MainPath stores the file path of the main package. On App Engine Standard 4 | // using Go version 1.9 and below, this will be unset. On App Engine Flex and 5 | // App Engine Standard second-gen (Go 1.11 and above), this will be the 6 | // filepath to package main. 7 | var MainPath string 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/main_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package internal 8 | 9 | import ( 10 | "io" 11 | "log" 12 | "net/http" 13 | "net/url" 14 | "os" 15 | "path/filepath" 16 | "runtime" 17 | ) 18 | 19 | func Main() { 20 | MainPath = filepath.Dir(findMainPath()) 21 | installHealthChecker(http.DefaultServeMux) 22 | 23 | port := "8080" 24 | if s := os.Getenv("PORT"); s != "" { 25 | port = s 26 | } 27 | 28 | host := "" 29 | if IsDevAppServer() { 30 | host = "127.0.0.1" 31 | } 32 | if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil { 33 | log.Fatalf("http.ListenAndServe: %v", err) 34 | } 35 | } 36 | 37 | // Find the path to package main by looking at the root Caller. 38 | func findMainPath() string { 39 | pc := make([]uintptr, 100) 40 | n := runtime.Callers(2, pc) 41 | frames := runtime.CallersFrames(pc[:n]) 42 | for { 43 | frame, more := frames.Next() 44 | // Tests won't have package main, instead they have testing.tRunner 45 | if frame.Function == "main.main" || frame.Function == "testing.tRunner" { 46 | return frame.File 47 | } 48 | if !more { 49 | break 50 | } 51 | } 52 | return "" 53 | } 54 | 55 | func installHealthChecker(mux *http.ServeMux) { 56 | // If no health check handler has been installed by this point, add a trivial one. 57 | const healthPath = "/_ah/health" 58 | hreq := &http.Request{ 59 | Method: "GET", 60 | URL: &url.URL{ 61 | Path: healthPath, 62 | }, 63 | } 64 | if _, pat := mux.Handler(hreq); pat != healthPath { 65 | mux.HandleFunc(healthPath, func(w http.ResponseWriter, r *http.Request) { 66 | io.WriteString(w, "ok") 67 | }) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/metadata.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file has code for accessing metadata. 8 | // 9 | // References: 10 | // https://cloud.google.com/compute/docs/metadata 11 | 12 | import ( 13 | "fmt" 14 | "io/ioutil" 15 | "net/http" 16 | "net/url" 17 | ) 18 | 19 | const ( 20 | metadataHost = "metadata" 21 | metadataPath = "/computeMetadata/v1/" 22 | ) 23 | 24 | var ( 25 | metadataRequestHeaders = http.Header{ 26 | "Metadata-Flavor": []string{"Google"}, 27 | } 28 | ) 29 | 30 | // TODO(dsymonds): Do we need to support default values, like Python? 31 | func mustGetMetadata(key string) []byte { 32 | b, err := getMetadata(key) 33 | if err != nil { 34 | panic(fmt.Sprintf("Metadata fetch failed for '%s': %v", key, err)) 35 | } 36 | return b 37 | } 38 | 39 | func getMetadata(key string) ([]byte, error) { 40 | // TODO(dsymonds): May need to use url.Parse to support keys with query args. 41 | req := &http.Request{ 42 | Method: "GET", 43 | URL: &url.URL{ 44 | Scheme: "http", 45 | Host: metadataHost, 46 | Path: metadataPath + key, 47 | }, 48 | Header: metadataRequestHeaders, 49 | Host: metadataHost, 50 | } 51 | resp, err := http.DefaultClient.Do(req) 52 | if err != nil { 53 | return nil, err 54 | } 55 | defer resp.Body.Close() 56 | if resp.StatusCode != 200 { 57 | return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode) 58 | } 59 | return ioutil.ReadAll(resp.Body) 60 | } 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | // This file implements a network dialer that limits the number of concurrent connections. 8 | // It is only used for API calls. 9 | 10 | import ( 11 | "log" 12 | "net" 13 | "runtime" 14 | "sync" 15 | "time" 16 | ) 17 | 18 | var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable. 19 | 20 | func limitRelease() { 21 | // non-blocking 22 | select { 23 | case <-limitSem: 24 | default: 25 | // This should not normally happen. 26 | log.Print("appengine: unbalanced limitSem release!") 27 | } 28 | } 29 | 30 | func limitDial(network, addr string) (net.Conn, error) { 31 | limitSem <- 1 32 | 33 | // Dial with a timeout in case the API host is MIA. 34 | // The connection should normally be very fast. 35 | conn, err := net.DialTimeout(network, addr, 10*time.Second) 36 | if err != nil { 37 | limitRelease() 38 | return nil, err 39 | } 40 | lc := &limitConn{Conn: conn} 41 | runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required 42 | return lc, nil 43 | } 44 | 45 | type limitConn struct { 46 | close sync.Once 47 | net.Conn 48 | } 49 | 50 | func (lc *limitConn) Close() error { 51 | defer lc.close.Do(func() { 52 | limitRelease() 53 | runtime.SetFinalizer(lc, nil) 54 | }) 55 | return lc.Conn.Close() 56 | } 57 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # This script rebuilds the generated code for the protocol buffers. 4 | # To run this you will need protoc and goprotobuf installed; 5 | # see https://github.com/golang/protobuf for instructions. 6 | 7 | PKG=google.golang.org/appengine 8 | 9 | function die() { 10 | echo 1>&2 $* 11 | exit 1 12 | } 13 | 14 | # Sanity check that the right tools are accessible. 15 | for tool in go protoc protoc-gen-go; do 16 | q=$(which $tool) || die "didn't find $tool" 17 | echo 1>&2 "$tool: $q" 18 | done 19 | 20 | echo -n 1>&2 "finding package dir... " 21 | pkgdir=$(go list -f '{{.Dir}}' $PKG) 22 | echo 1>&2 $pkgdir 23 | base=$(echo $pkgdir | sed "s,/$PKG\$,,") 24 | echo 1>&2 "base: $base" 25 | cd $base 26 | 27 | # Run protoc once per package. 28 | for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do 29 | echo 1>&2 "* $dir" 30 | protoc --go_out=. $dir/*.proto 31 | done 32 | 33 | for f in $(find $PKG/internal -name '*.pb.go'); do 34 | # Remove proto.RegisterEnum calls. 35 | # These cause duplicate registration panics when these packages 36 | # are used on classic App Engine. proto.RegisterEnum only affects 37 | # parsing the text format; we don't care about that. 38 | # https://code.google.com/p/googleappengine/issues/detail?id=11670#c17 39 | sed -i '/proto.RegisterEnum/d' $f 40 | done 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "remote_api"; 3 | 4 | package remote_api; 5 | 6 | message Request { 7 | required string service_name = 2; 8 | required string method = 3; 9 | required bytes request = 4; 10 | optional string request_id = 5; 11 | } 12 | 13 | message ApplicationError { 14 | required int32 code = 1; 15 | required string detail = 2; 16 | } 17 | 18 | message RpcError { 19 | enum ErrorCode { 20 | UNKNOWN = 0; 21 | CALL_NOT_FOUND = 1; 22 | PARSE_ERROR = 2; 23 | SECURITY_VIOLATION = 3; 24 | OVER_QUOTA = 4; 25 | REQUEST_TOO_LARGE = 5; 26 | CAPABILITY_DISABLED = 6; 27 | FEATURE_DISABLED = 7; 28 | BAD_REQUEST = 8; 29 | RESPONSE_TOO_LARGE = 9; 30 | CANCELLED = 10; 31 | REPLAY_ERROR = 11; 32 | DEADLINE_EXCEEDED = 12; 33 | } 34 | required int32 code = 1; 35 | optional string detail = 2; 36 | } 37 | 38 | message Response { 39 | optional bytes response = 1; 40 | optional bytes exception = 2; 41 | optional ApplicationError application_error = 3; 42 | optional bytes java_exception = 4; 43 | optional RpcError rpc_error = 5; 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | option go_package = "urlfetch"; 3 | 4 | package appengine; 5 | 6 | message URLFetchServiceError { 7 | enum ErrorCode { 8 | OK = 0; 9 | INVALID_URL = 1; 10 | FETCH_ERROR = 2; 11 | UNSPECIFIED_ERROR = 3; 12 | RESPONSE_TOO_LARGE = 4; 13 | DEADLINE_EXCEEDED = 5; 14 | SSL_CERTIFICATE_ERROR = 6; 15 | DNS_ERROR = 7; 16 | CLOSED = 8; 17 | INTERNAL_TRANSIENT_ERROR = 9; 18 | TOO_MANY_REDIRECTS = 10; 19 | MALFORMED_REPLY = 11; 20 | CONNECTION_ERROR = 12; 21 | } 22 | } 23 | 24 | message URLFetchRequest { 25 | enum RequestMethod { 26 | GET = 1; 27 | POST = 2; 28 | HEAD = 3; 29 | PUT = 4; 30 | DELETE = 5; 31 | PATCH = 6; 32 | } 33 | required RequestMethod Method = 1; 34 | required string Url = 2; 35 | repeated group Header = 3 { 36 | required string Key = 4; 37 | required string Value = 5; 38 | } 39 | optional bytes Payload = 6 [ctype=CORD]; 40 | 41 | optional bool FollowRedirects = 7 [default=true]; 42 | 43 | optional double Deadline = 8; 44 | 45 | optional bool MustValidateServerCertificate = 9 [default=true]; 46 | } 47 | 48 | message URLFetchResponse { 49 | optional bytes Content = 1; 50 | required int32 StatusCode = 2; 51 | repeated group Header = 3 { 52 | required string Key = 4; 53 | required string Value = 5; 54 | } 55 | optional bool ContentWasTruncated = 6 [default=false]; 56 | optional int64 ExternalBytesSent = 7; 57 | optional int64 ExternalBytesReceived = 8; 58 | 59 | optional string FinalUrl = 9; 60 | 61 | optional int64 ApiCpuMilliseconds = 10 [default=0]; 62 | optional int64 ApiBytesSent = 11 [default=0]; 63 | optional int64 ApiBytesReceived = 12 [default=0]; 64 | } 65 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/encoding/prototext/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package prototext marshals and unmarshals protocol buffer messages as the 6 | // textproto format. 7 | package prototext 8 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/descopts/options.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package descopts contains the nil pointers to concrete descriptor options. 6 | // 7 | // This package exists as a form of reverse dependency injection so that certain 8 | // packages (e.g., internal/filedesc and internal/filetype can avoid a direct 9 | // dependency on the descriptor proto package). 10 | package descopts 11 | 12 | import pref "google.golang.org/protobuf/reflect/protoreflect" 13 | 14 | // These variables are set by the init function in descriptor.pb.go via logic 15 | // in internal/filetype. In other words, so long as the descriptor proto package 16 | // is linked in, these variables will be populated. 17 | // 18 | // Each variable is populated with a nil pointer to the options struct. 19 | var ( 20 | File pref.ProtoMessage 21 | Enum pref.ProtoMessage 22 | EnumValue pref.ProtoMessage 23 | Message pref.ProtoMessage 24 | Field pref.ProtoMessage 25 | Oneof pref.ProtoMessage 26 | ExtensionRange pref.ProtoMessage 27 | Service pref.ProtoMessage 28 | Method pref.ProtoMessage 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/detrand/rand.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package detrand provides deterministically random functionality. 6 | // 7 | // The pseudo-randomness of these functions is seeded by the program binary 8 | // itself and guarantees that the output does not change within a program, 9 | // while ensuring that the output is unstable across different builds. 10 | package detrand 11 | 12 | import ( 13 | "encoding/binary" 14 | "hash/fnv" 15 | "os" 16 | ) 17 | 18 | // Disable disables detrand such that all functions returns the zero value. 19 | // This function is not concurrent-safe and must be called during program init. 20 | func Disable() { 21 | randSeed = 0 22 | } 23 | 24 | // Bool returns a deterministically random boolean. 25 | func Bool() bool { 26 | return randSeed%2 == 1 27 | } 28 | 29 | // Intn returns a deterministically random integer between 0 and n-1, inclusive. 30 | func Intn(n int) int { 31 | if n <= 0 { 32 | panic("must be positive") 33 | } 34 | return int(randSeed % uint64(n)) 35 | } 36 | 37 | // randSeed is a best-effort at an approximate hash of the Go binary. 38 | var randSeed = binaryHash() 39 | 40 | func binaryHash() uint64 { 41 | // Open the Go binary. 42 | s, err := os.Executable() 43 | if err != nil { 44 | return 0 45 | } 46 | f, err := os.Open(s) 47 | if err != nil { 48 | return 0 49 | } 50 | defer f.Close() 51 | 52 | // Hash the size and several samples of the Go binary. 53 | const numSamples = 8 54 | var buf [64]byte 55 | h := fnv.New64() 56 | fi, err := f.Stat() 57 | if err != nil { 58 | return 0 59 | } 60 | binary.LittleEndian.PutUint64(buf[:8], uint64(fi.Size())) 61 | h.Write(buf[:8]) 62 | for i := int64(0); i < numSamples; i++ { 63 | if _, err := f.ReadAt(buf[:], i*fi.Size()/numSamples); err != nil { 64 | return 0 65 | } 66 | h.Write(buf[:]) 67 | } 68 | return h.Sum64() 69 | } 70 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/encoding/text/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package text implements the text format for protocol buffers. 6 | // This package has no semantic understanding for protocol buffers and is only 7 | // a parser and composer for the format. 8 | // 9 | // There is no formal specification for the protobuf text format, as such the 10 | // C++ implementation (see google::protobuf::TextFormat) is the reference 11 | // implementation of the text format. 12 | // 13 | // This package is neither a superset nor a subset of the C++ implementation. 14 | // This implementation permits a more liberal grammar in some cases to be 15 | // backwards compatible with the historical Go implementation. 16 | // Future parsings unique to Go should not be added. 17 | // Some grammars allowed by the C++ implementation are deliberately 18 | // not implemented here because they are considered a bug by the protobuf team 19 | // and should not be replicated. 20 | // 21 | // The Go implementation should implement a sufficient amount of the C++ 22 | // grammar such that the default text serialization by C++ can be parsed by Go. 23 | // However, just because the C++ parser accepts some input does not mean that 24 | // the Go implementation should as well. 25 | // 26 | // The text format is almost a superset of JSON except: 27 | // * message keys are not quoted strings, but identifiers 28 | // * the top-level value must be a message without the delimiters 29 | package text 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.13 6 | // +build !go1.13 7 | 8 | package errors 9 | 10 | import "reflect" 11 | 12 | // Is is a copy of Go 1.13's errors.Is for use with older Go versions. 13 | func Is(err, target error) bool { 14 | if target == nil { 15 | return err == target 16 | } 17 | 18 | isComparable := reflect.TypeOf(target).Comparable() 19 | for { 20 | if isComparable && err == target { 21 | return true 22 | } 23 | if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) { 24 | return true 25 | } 26 | if err = unwrap(err); err == nil { 27 | return false 28 | } 29 | } 30 | } 31 | 32 | func unwrap(err error) error { 33 | u, ok := err.(interface { 34 | Unwrap() error 35 | }) 36 | if !ok { 37 | return nil 38 | } 39 | return u.Unwrap() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/errors/is_go113.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.13 6 | // +build go1.13 7 | 8 | package errors 9 | 10 | import "errors" 11 | 12 | // Is is errors.Is. 13 | func Is(err, target error) bool { return errors.Is(err, target) } 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/flags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package flags provides a set of flags controlled by build tags. 6 | package flags 7 | 8 | // ProtoLegacy specifies whether to enable support for legacy functionality 9 | // such as MessageSets, weak fields, and various other obscure behavior 10 | // that is necessary to maintain backwards compatibility with proto1 or 11 | // the pre-release variants of proto2 and proto3. 12 | // 13 | // This is disabled by default unless built with the "protolegacy" tag. 14 | // 15 | // WARNING: The compatibility agreement covers nothing provided by this flag. 16 | // As such, functionality may suddenly be removed or changed at our discretion. 17 | const ProtoLegacy = protoLegacy 18 | 19 | // LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions. 20 | // 21 | // Lazy extension unmarshaling validates the contents of message-valued 22 | // extension fields at unmarshal time, but defers creating the message 23 | // structure until the extension is first accessed. 24 | const LazyUnmarshalExtensions = ProtoLegacy 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !protolegacy 6 | // +build !protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = false 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build protolegacy 6 | // +build protolegacy 7 | 8 | package flags 9 | 10 | const protoLegacy = true 11 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/any_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_any_proto = "google/protobuf/any.proto" 14 | 15 | // Names for google.protobuf.Any. 16 | const ( 17 | Any_message_name protoreflect.Name = "Any" 18 | Any_message_fullname protoreflect.FullName = "google.protobuf.Any" 19 | ) 20 | 21 | // Field names for google.protobuf.Any. 22 | const ( 23 | Any_TypeUrl_field_name protoreflect.Name = "type_url" 24 | Any_Value_field_name protoreflect.Name = "value" 25 | 26 | Any_TypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Any.type_url" 27 | Any_Value_field_fullname protoreflect.FullName = "google.protobuf.Any.value" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Any. 31 | const ( 32 | Any_TypeUrl_field_number protoreflect.FieldNumber = 1 33 | Any_Value_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package genid contains constants for declarations in descriptor.proto 6 | // and the well-known types. 7 | package genid 8 | 9 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 10 | 11 | const GoogleProtobuf_package protoreflect.FullName = "google.protobuf" 12 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/duration_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_duration_proto = "google/protobuf/duration.proto" 14 | 15 | // Names for google.protobuf.Duration. 16 | const ( 17 | Duration_message_name protoreflect.Name = "Duration" 18 | Duration_message_fullname protoreflect.FullName = "google.protobuf.Duration" 19 | ) 20 | 21 | // Field names for google.protobuf.Duration. 22 | const ( 23 | Duration_Seconds_field_name protoreflect.Name = "seconds" 24 | Duration_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Duration_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Duration.seconds" 27 | Duration_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Duration.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Duration. 31 | const ( 32 | Duration_Seconds_field_number protoreflect.FieldNumber = 1 33 | Duration_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/empty_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_empty_proto = "google/protobuf/empty.proto" 14 | 15 | // Names for google.protobuf.Empty. 16 | const ( 17 | Empty_message_name protoreflect.Name = "Empty" 18 | Empty_message_fullname protoreflect.FullName = "google.protobuf.Empty" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_field_mask_proto = "google/protobuf/field_mask.proto" 14 | 15 | // Names for google.protobuf.FieldMask. 16 | const ( 17 | FieldMask_message_name protoreflect.Name = "FieldMask" 18 | FieldMask_message_fullname protoreflect.FullName = "google.protobuf.FieldMask" 19 | ) 20 | 21 | // Field names for google.protobuf.FieldMask. 22 | const ( 23 | FieldMask_Paths_field_name protoreflect.Name = "paths" 24 | 25 | FieldMask_Paths_field_fullname protoreflect.FullName = "google.protobuf.FieldMask.paths" 26 | ) 27 | 28 | // Field numbers for google.protobuf.FieldMask. 29 | const ( 30 | FieldMask_Paths_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/goname.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | // Go names of implementation-specific struct fields in generated messages. 8 | const ( 9 | State_goname = "state" 10 | 11 | SizeCache_goname = "sizeCache" 12 | SizeCacheA_goname = "XXX_sizecache" 13 | 14 | WeakFields_goname = "weakFields" 15 | WeakFieldsA_goname = "XXX_weak" 16 | 17 | UnknownFields_goname = "unknownFields" 18 | UnknownFieldsA_goname = "XXX_unrecognized" 19 | 20 | ExtensionFields_goname = "extensionFields" 21 | ExtensionFieldsA_goname = "XXX_InternalExtensions" 22 | ExtensionFieldsB_goname = "XXX_extensions" 23 | 24 | WeakFieldPrefix_goname = "XXX_weak_" 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/map_entry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field names and numbers for synthetic map entry messages. 10 | const ( 11 | MapEntry_Key_field_name protoreflect.Name = "key" 12 | MapEntry_Value_field_name protoreflect.Name = "value" 13 | 14 | MapEntry_Key_field_number protoreflect.FieldNumber = 1 15 | MapEntry_Value_field_number protoreflect.FieldNumber = 2 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_source_context_proto = "google/protobuf/source_context.proto" 14 | 15 | // Names for google.protobuf.SourceContext. 16 | const ( 17 | SourceContext_message_name protoreflect.Name = "SourceContext" 18 | SourceContext_message_fullname protoreflect.FullName = "google.protobuf.SourceContext" 19 | ) 20 | 21 | // Field names for google.protobuf.SourceContext. 22 | const ( 23 | SourceContext_FileName_field_name protoreflect.Name = "file_name" 24 | 25 | SourceContext_FileName_field_fullname protoreflect.FullName = "google.protobuf.SourceContext.file_name" 26 | ) 27 | 28 | // Field numbers for google.protobuf.SourceContext. 29 | const ( 30 | SourceContext_FileName_field_number protoreflect.FieldNumber = 1 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-protos. DO NOT EDIT. 6 | 7 | package genid 8 | 9 | import ( 10 | protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | const File_google_protobuf_timestamp_proto = "google/protobuf/timestamp.proto" 14 | 15 | // Names for google.protobuf.Timestamp. 16 | const ( 17 | Timestamp_message_name protoreflect.Name = "Timestamp" 18 | Timestamp_message_fullname protoreflect.FullName = "google.protobuf.Timestamp" 19 | ) 20 | 21 | // Field names for google.protobuf.Timestamp. 22 | const ( 23 | Timestamp_Seconds_field_name protoreflect.Name = "seconds" 24 | Timestamp_Nanos_field_name protoreflect.Name = "nanos" 25 | 26 | Timestamp_Seconds_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.seconds" 27 | Timestamp_Nanos_field_fullname protoreflect.FullName = "google.protobuf.Timestamp.nanos" 28 | ) 29 | 30 | // Field numbers for google.protobuf.Timestamp. 31 | const ( 32 | Timestamp_Seconds_field_number protoreflect.FieldNumber = 1 33 | Timestamp_Nanos_field_number protoreflect.FieldNumber = 2 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/genid/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package genid 6 | 7 | import protoreflect "google.golang.org/protobuf/reflect/protoreflect" 8 | 9 | // Generic field name and number for messages in wrappers.proto. 10 | const ( 11 | WrapperValue_Value_field_name protoreflect.Name = "value" 12 | WrapperValue_Value_field_number protoreflect.FieldNumber = 1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.12 6 | // +build !go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | type mapIter struct { 13 | v reflect.Value 14 | keys []reflect.Value 15 | } 16 | 17 | // mapRange provides a less-efficient equivalent to 18 | // the Go 1.12 reflect.Value.MapRange method. 19 | func mapRange(v reflect.Value) *mapIter { 20 | return &mapIter{v: v} 21 | } 22 | 23 | func (i *mapIter) Next() bool { 24 | if i.keys == nil { 25 | i.keys = i.v.MapKeys() 26 | } else { 27 | i.keys = i.keys[1:] 28 | } 29 | return len(i.keys) > 0 30 | } 31 | 32 | func (i *mapIter) Key() reflect.Value { 33 | return i.keys[0] 34 | } 35 | 36 | func (i *mapIter) Value() reflect.Value { 37 | return i.v.MapIndex(i.keys[0]) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.12 6 | // +build go1.12 7 | 8 | package impl 9 | 10 | import "reflect" 11 | 12 | func mapRange(v reflect.Value) *reflect.MapIter { return v.MapRange() } 13 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !purego && !appengine 6 | // +build !purego,!appengine 7 | 8 | package impl 9 | 10 | // When using unsafe pointers, we can just treat enum values as int32s. 11 | 12 | var ( 13 | coderEnumNoZero = coderInt32NoZero 14 | coderEnum = coderInt32 15 | coderEnumPtr = coderInt32Ptr 16 | coderEnumSlice = coderInt32Slice 17 | coderEnumPackedSlice = coderInt32PackedSlice 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/enum.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "reflect" 9 | 10 | pref "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | type EnumInfo struct { 14 | GoReflectType reflect.Type // int32 kind 15 | Desc pref.EnumDescriptor 16 | } 17 | 18 | func (t *EnumInfo) New(n pref.EnumNumber) pref.Enum { 19 | return reflect.ValueOf(n).Convert(t.GoReflectType).Interface().(pref.Enum) 20 | } 21 | func (t *EnumInfo) Descriptor() pref.EnumDescriptor { return t.Desc } 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/impl/weak.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package impl 6 | 7 | import ( 8 | "fmt" 9 | 10 | pref "google.golang.org/protobuf/reflect/protoreflect" 11 | "google.golang.org/protobuf/reflect/protoregistry" 12 | ) 13 | 14 | // weakFields adds methods to the exported WeakFields type for internal use. 15 | // 16 | // The exported type is an alias to an unnamed type, so methods can't be 17 | // defined directly on it. 18 | type weakFields WeakFields 19 | 20 | func (w weakFields) get(num pref.FieldNumber) (pref.ProtoMessage, bool) { 21 | m, ok := w[int32(num)] 22 | return m, ok 23 | } 24 | 25 | func (w *weakFields) set(num pref.FieldNumber, m pref.ProtoMessage) { 26 | if *w == nil { 27 | *w = make(weakFields) 28 | } 29 | (*w)[int32(num)] = m 30 | } 31 | 32 | func (w *weakFields) clear(num pref.FieldNumber) { 33 | delete(*w, int32(num)) 34 | } 35 | 36 | func (Export) HasWeak(w WeakFields, num pref.FieldNumber) bool { 37 | _, ok := w[int32(num)] 38 | return ok 39 | } 40 | 41 | func (Export) ClearWeak(w *WeakFields, num pref.FieldNumber) { 42 | delete(*w, int32(num)) 43 | } 44 | 45 | func (Export) GetWeak(w WeakFields, num pref.FieldNumber, name pref.FullName) pref.ProtoMessage { 46 | if m, ok := w[int32(num)]; ok { 47 | return m 48 | } 49 | mt, _ := protoregistry.GlobalTypes.FindMessageByName(name) 50 | if mt == nil { 51 | panic(fmt.Sprintf("message %v for weak field is not linked in", name)) 52 | } 53 | return mt.Zero().Interface() 54 | } 55 | 56 | func (Export) SetWeak(w *WeakFields, num pref.FieldNumber, name pref.FullName, m pref.ProtoMessage) { 57 | if m != nil { 58 | mt, _ := protoregistry.GlobalTypes.FindMessageByName(name) 59 | if mt == nil { 60 | panic(fmt.Sprintf("message %v for weak field is not linked in", name)) 61 | } 62 | if mt != m.ProtoReflect().Type() { 63 | panic(fmt.Sprintf("invalid message type for weak field: got %T, want %T", m, mt.Zero().Interface())) 64 | } 65 | } 66 | if m == nil || !m.ProtoReflect().IsValid() { 67 | delete(*w, int32(num)) 68 | return 69 | } 70 | if *w == nil { 71 | *w = make(weakFields) 72 | } 73 | (*w)[int32(num)] = m 74 | } 75 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/pragma/pragma.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package pragma provides types that can be embedded into a struct to 6 | // statically enforce or prevent certain language properties. 7 | package pragma 8 | 9 | import "sync" 10 | 11 | // NoUnkeyedLiterals can be embedded in a struct to prevent unkeyed literals. 12 | type NoUnkeyedLiterals struct{} 13 | 14 | // DoNotImplement can be embedded in an interface to prevent trivial 15 | // implementations of the interface. 16 | // 17 | // This is useful to prevent unauthorized implementations of an interface 18 | // so that it can be extended in the future for any protobuf language changes. 19 | type DoNotImplement interface{ ProtoInternal(DoNotImplement) } 20 | 21 | // DoNotCompare can be embedded in a struct to prevent comparability. 22 | type DoNotCompare [0]func() 23 | 24 | // DoNotCopy can be embedded in a struct to help prevent shallow copies. 25 | // This does not rely on a Go language feature, but rather a special case 26 | // within the vet checker. 27 | // 28 | // See https://golang.org/issues/8005. 29 | type DoNotCopy [0]sync.Mutex 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/set/ints.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package set provides simple set data structures for uint64s. 6 | package set 7 | 8 | import "math/bits" 9 | 10 | // int64s represents a set of integers within the range of 0..63. 11 | type int64s uint64 12 | 13 | func (bs *int64s) Len() int { 14 | return bits.OnesCount64(uint64(*bs)) 15 | } 16 | func (bs *int64s) Has(n uint64) bool { 17 | return uint64(*bs)&(uint64(1)< 0 18 | } 19 | func (bs *int64s) Set(n uint64) { 20 | *(*uint64)(bs) |= uint64(1) << n 21 | } 22 | func (bs *int64s) Clear(n uint64) { 23 | *(*uint64)(bs) &^= uint64(1) << n 24 | } 25 | 26 | // Ints represents a set of integers within the range of 0..math.MaxUint64. 27 | type Ints struct { 28 | lo int64s 29 | hi map[uint64]struct{} 30 | } 31 | 32 | func (bs *Ints) Len() int { 33 | return bs.lo.Len() + len(bs.hi) 34 | } 35 | func (bs *Ints) Has(n uint64) bool { 36 | if n < 64 { 37 | return bs.lo.Has(n) 38 | } 39 | _, ok := bs.hi[n] 40 | return ok 41 | } 42 | func (bs *Ints) Set(n uint64) { 43 | if n < 64 { 44 | bs.lo.Set(n) 45 | return 46 | } 47 | if bs.hi == nil { 48 | bs.hi = make(map[uint64]struct{}) 49 | } 50 | bs.hi[n] = struct{}{} 51 | } 52 | func (bs *Ints) Clear(n uint64) { 53 | if n < 64 { 54 | bs.lo.Clear(n) 55 | return 56 | } 57 | delete(bs.hi, n) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/internal/strs/strings_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build purego || appengine 6 | // +build purego appengine 7 | 8 | package strs 9 | 10 | import pref "google.golang.org/protobuf/reflect/protoreflect" 11 | 12 | func UnsafeString(b []byte) string { 13 | return string(b) 14 | } 15 | 16 | func UnsafeBytes(s string) []byte { 17 | return []byte(s) 18 | } 19 | 20 | type Builder struct{} 21 | 22 | func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName { 23 | return prefix.Append(name) 24 | } 25 | 26 | func (*Builder) MakeString(b []byte) string { 27 | return string(b) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/checkinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | "google.golang.org/protobuf/runtime/protoiface" 11 | ) 12 | 13 | // CheckInitialized returns an error if any required fields in m are not set. 14 | func CheckInitialized(m Message) error { 15 | // Treat a nil message interface as an "untyped" empty message, 16 | // which we assume to have no required fields. 17 | if m == nil { 18 | return nil 19 | } 20 | 21 | return checkInitialized(m.ProtoReflect()) 22 | } 23 | 24 | // CheckInitialized returns an error if any required fields in m are not set. 25 | func checkInitialized(m protoreflect.Message) error { 26 | if methods := protoMethods(m); methods != nil && methods.CheckInitialized != nil { 27 | _, err := methods.CheckInitialized(protoiface.CheckInitializedInput{ 28 | Message: m, 29 | }) 30 | return err 31 | } 32 | return checkInitializedSlow(m) 33 | } 34 | 35 | func checkInitializedSlow(m protoreflect.Message) error { 36 | md := m.Descriptor() 37 | fds := md.Fields() 38 | for i, nums := 0, md.RequiredNumbers(); i < nums.Len(); i++ { 39 | fd := fds.ByNumber(nums.Get(i)) 40 | if !m.Has(fd) { 41 | return errors.RequiredNotSet(string(fd.FullName())) 42 | } 43 | } 44 | var err error 45 | m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { 46 | switch { 47 | case fd.IsList(): 48 | if fd.Message() == nil { 49 | return true 50 | } 51 | for i, list := 0, v.List(); i < list.Len() && err == nil; i++ { 52 | err = checkInitialized(list.Get(i).Message()) 53 | } 54 | case fd.IsMap(): 55 | if fd.MapValue().Message() == nil { 56 | return true 57 | } 58 | v.Map().Range(func(key protoreflect.MapKey, v protoreflect.Value) bool { 59 | err = checkInitialized(v.Message()) 60 | return err == nil 61 | }) 62 | default: 63 | if fd.Message() == nil { 64 | return true 65 | } 66 | err = checkInitialized(v.Message()) 67 | } 68 | return err == nil 69 | }) 70 | return err 71 | } 72 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/errors" 9 | "google.golang.org/protobuf/reflect/protoreflect" 10 | ) 11 | 12 | // Message is the top-level interface that all messages must implement. 13 | // It provides access to a reflective view of a message. 14 | // Any implementation of this interface may be used with all functions in the 15 | // protobuf module that accept a Message, except where otherwise specified. 16 | // 17 | // This is the v2 interface definition for protobuf messages. 18 | // The v1 interface definition is "github.com/golang/protobuf/proto".Message. 19 | // 20 | // To convert a v1 message to a v2 message, 21 | // use "github.com/golang/protobuf/proto".MessageV2. 22 | // To convert a v2 message to a v1 message, 23 | // use "github.com/golang/protobuf/proto".MessageV1. 24 | type Message = protoreflect.ProtoMessage 25 | 26 | // Error matches all errors produced by packages in the protobuf module. 27 | // 28 | // That is, errors.Is(err, Error) reports whether an error is produced 29 | // by this module. 30 | var Error error 31 | 32 | func init() { 33 | Error = errors.Error 34 | } 35 | 36 | // MessageName returns the full name of m. 37 | // If m is nil, it returns an empty string. 38 | func MessageName(m Message) protoreflect.FullName { 39 | if m == nil { 40 | return "" 41 | } 42 | return m.ProtoReflect().Descriptor().FullName() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_methods.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build !protoreflect 7 | // +build !protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = true 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return m.ProtoMethods() 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/proto_reflect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // The protoreflect build tag disables use of fast-path methods. 6 | //go:build protoreflect 7 | // +build protoreflect 8 | 9 | package proto 10 | 11 | import ( 12 | "google.golang.org/protobuf/reflect/protoreflect" 13 | "google.golang.org/protobuf/runtime/protoiface" 14 | ) 15 | 16 | const hasProtoMethods = false 17 | 18 | func protoMethods(m protoreflect.Message) *protoiface.Methods { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/reset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | import ( 8 | "fmt" 9 | 10 | "google.golang.org/protobuf/reflect/protoreflect" 11 | ) 12 | 13 | // Reset clears every field in the message. 14 | // The resulting message shares no observable memory with its previous state 15 | // other than the memory for the message itself. 16 | func Reset(m Message) { 17 | if mr, ok := m.(interface{ Reset() }); ok && hasProtoMethods { 18 | mr.Reset() 19 | return 20 | } 21 | resetMessage(m.ProtoReflect()) 22 | } 23 | 24 | func resetMessage(m protoreflect.Message) { 25 | if !m.IsValid() { 26 | panic(fmt.Sprintf("cannot reset invalid %v message", m.Descriptor().FullName())) 27 | } 28 | 29 | // Clear all known fields. 30 | fds := m.Descriptor().Fields() 31 | for i := 0; i < fds.Len(); i++ { 32 | m.Clear(fds.Get(i)) 33 | } 34 | 35 | // Clear extension fields. 36 | m.Range(func(fd protoreflect.FieldDescriptor, _ protoreflect.Value) bool { 37 | m.Clear(fd) 38 | return true 39 | }) 40 | 41 | // Clear unknown fields. 42 | m.SetUnknown(nil) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/size_gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Code generated by generate-types. DO NOT EDIT. 6 | 7 | package proto 8 | 9 | import ( 10 | "google.golang.org/protobuf/encoding/protowire" 11 | "google.golang.org/protobuf/reflect/protoreflect" 12 | ) 13 | 14 | func (o MarshalOptions) sizeSingular(num protowire.Number, kind protoreflect.Kind, v protoreflect.Value) int { 15 | switch kind { 16 | case protoreflect.BoolKind: 17 | return protowire.SizeVarint(protowire.EncodeBool(v.Bool())) 18 | case protoreflect.EnumKind: 19 | return protowire.SizeVarint(uint64(v.Enum())) 20 | case protoreflect.Int32Kind: 21 | return protowire.SizeVarint(uint64(int32(v.Int()))) 22 | case protoreflect.Sint32Kind: 23 | return protowire.SizeVarint(protowire.EncodeZigZag(int64(int32(v.Int())))) 24 | case protoreflect.Uint32Kind: 25 | return protowire.SizeVarint(uint64(uint32(v.Uint()))) 26 | case protoreflect.Int64Kind: 27 | return protowire.SizeVarint(uint64(v.Int())) 28 | case protoreflect.Sint64Kind: 29 | return protowire.SizeVarint(protowire.EncodeZigZag(v.Int())) 30 | case protoreflect.Uint64Kind: 31 | return protowire.SizeVarint(v.Uint()) 32 | case protoreflect.Sfixed32Kind: 33 | return protowire.SizeFixed32() 34 | case protoreflect.Fixed32Kind: 35 | return protowire.SizeFixed32() 36 | case protoreflect.FloatKind: 37 | return protowire.SizeFixed32() 38 | case protoreflect.Sfixed64Kind: 39 | return protowire.SizeFixed64() 40 | case protoreflect.Fixed64Kind: 41 | return protowire.SizeFixed64() 42 | case protoreflect.DoubleKind: 43 | return protowire.SizeFixed64() 44 | case protoreflect.StringKind: 45 | return protowire.SizeBytes(len(v.String())) 46 | case protoreflect.BytesKind: 47 | return protowire.SizeBytes(len(v.Bytes())) 48 | case protoreflect.MessageKind: 49 | return protowire.SizeBytes(o.size(v.Message())) 50 | case protoreflect.GroupKind: 51 | return protowire.SizeGroup(num, o.size(v.Message())) 52 | default: 53 | return 0 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/proto/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proto 6 | 7 | // Bool stores v in a new bool value and returns a pointer to it. 8 | func Bool(v bool) *bool { return &v } 9 | 10 | // Int32 stores v in a new int32 value and returns a pointer to it. 11 | func Int32(v int32) *int32 { return &v } 12 | 13 | // Int64 stores v in a new int64 value and returns a pointer to it. 14 | func Int64(v int64) *int64 { return &v } 15 | 16 | // Float32 stores v in a new float32 value and returns a pointer to it. 17 | func Float32(v float32) *float32 { return &v } 18 | 19 | // Float64 stores v in a new float64 value and returns a pointer to it. 20 | func Float64(v float64) *float64 { return &v } 21 | 22 | // Uint32 stores v in a new uint32 value and returns a pointer to it. 23 | func Uint32(v uint32) *uint32 { return &v } 24 | 25 | // Uint64 stores v in a new uint64 value and returns a pointer to it. 26 | func Uint64(v uint64) *uint64 { return &v } 27 | 28 | // String stores v in a new string value and returns a pointer to it. 29 | func String(v string) *string { return &v } 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build purego || appengine 6 | // +build purego appengine 7 | 8 | package protoreflect 9 | 10 | import "google.golang.org/protobuf/internal/pragma" 11 | 12 | type valueType int 13 | 14 | const ( 15 | nilType valueType = iota 16 | boolType 17 | int32Type 18 | int64Type 19 | uint32Type 20 | uint64Type 21 | float32Type 22 | float64Type 23 | stringType 24 | bytesType 25 | enumType 26 | ifaceType 27 | ) 28 | 29 | // value is a union where only one type can be represented at a time. 30 | // This uses a distinct field for each type. This is type safe in Go, but 31 | // occupies more memory than necessary (72B). 32 | type value struct { 33 | pragma.DoNotCompare // 0B 34 | 35 | typ valueType // 8B 36 | num uint64 // 8B 37 | str string // 16B 38 | bin []byte // 24B 39 | iface interface{} // 16B 40 | } 41 | 42 | func valueOfString(v string) Value { 43 | return Value{typ: stringType, str: v} 44 | } 45 | func valueOfBytes(v []byte) Value { 46 | return Value{typ: bytesType, bin: v} 47 | } 48 | func valueOfIface(v interface{}) Value { 49 | return Value{typ: ifaceType, iface: v} 50 | } 51 | 52 | func (v Value) getString() string { 53 | return v.str 54 | } 55 | func (v Value) getBytes() []byte { 56 | return v.bin 57 | } 58 | func (v Value) getIface() interface{} { 59 | return v.iface 60 | } 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoiface 6 | 7 | type MessageV1 interface { 8 | Reset() 9 | String() string 10 | ProtoMessage() 11 | } 12 | 13 | type ExtensionRangeV1 struct { 14 | Start, End int32 // both inclusive 15 | } 16 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package protoimpl contains the default implementation for messages 6 | // generated by protoc-gen-go. 7 | // 8 | // WARNING: This package should only ever be imported by generated messages. 9 | // The compatibility agreement covers nothing except for functionality needed 10 | // to keep existing generated messages operational. Breakages that occur due 11 | // to unauthorized usages of this package are not the author's responsibility. 12 | package protoimpl 13 | 14 | import ( 15 | "google.golang.org/protobuf/internal/filedesc" 16 | "google.golang.org/protobuf/internal/filetype" 17 | "google.golang.org/protobuf/internal/impl" 18 | ) 19 | 20 | // UnsafeEnabled specifies whether package unsafe can be used. 21 | const UnsafeEnabled = impl.UnsafeEnabled 22 | 23 | type ( 24 | // Types used by generated code in init functions. 25 | DescBuilder = filedesc.Builder 26 | TypeBuilder = filetype.Builder 27 | 28 | // Types used by generated code to implement EnumType, MessageType, and ExtensionType. 29 | EnumInfo = impl.EnumInfo 30 | MessageInfo = impl.MessageInfo 31 | ExtensionInfo = impl.ExtensionInfo 32 | 33 | // Types embedded in generated messages. 34 | MessageState = impl.MessageState 35 | SizeCache = impl.SizeCache 36 | WeakFields = impl.WeakFields 37 | UnknownFields = impl.UnknownFields 38 | ExtensionFields = impl.ExtensionFields 39 | ExtensionFieldV1 = impl.ExtensionField 40 | 41 | Pointer = impl.Pointer 42 | ) 43 | 44 | var X impl.Export 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/protobuf/runtime/protoimpl/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package protoimpl 6 | 7 | import ( 8 | "google.golang.org/protobuf/internal/version" 9 | ) 10 | 11 | const ( 12 | // MaxVersion is the maximum supported version for generated .pb.go files. 13 | // It is always the current version of the module. 14 | MaxVersion = version.Minor 15 | 16 | // GenVersion is the runtime version required by generated .pb.go files. 17 | // This is incremented when generated code relies on new functionality 18 | // in the runtime. 19 | GenVersion = 20 20 | 21 | // MinVersion is the minimum supported version for generated .pb.go files. 22 | // This is incremented when the runtime drops support for old code. 23 | MinVersion = 0 24 | ) 25 | 26 | // EnforceVersion is used by code generated by protoc-gen-go 27 | // to statically enforce minimum and maximum versions of this package. 28 | // A compilation failure implies either that: 29 | // * the runtime package is too old and needs to be updated OR 30 | // * the generated code is too old and needs to be regenerated. 31 | // 32 | // The runtime package can be upgraded by running: 33 | // go get google.golang.org/protobuf 34 | // 35 | // The generated code can be regenerated by running: 36 | // protoc --go_out=${PROTOC_GEN_GO_ARGS} ${PROTO_FILES} 37 | // 38 | // Example usage by generated code: 39 | // const ( 40 | // // Verify that this generated code is sufficiently up-to-date. 41 | // _ = protoimpl.EnforceVersion(genVersion - protoimpl.MinVersion) 42 | // // Verify that runtime/protoimpl is sufficiently up-to-date. 43 | // _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - genVersion) 44 | // ) 45 | // 46 | // The genVersion is the current minor version used to generated the code. 47 | // This compile-time check relies on negative integer overflow of a uint 48 | // being a compilation failure (guaranteed by the Go specification). 49 | type EnforceVersion uint 50 | 51 | // This enforces the following invariant: 52 | // MinVersion ≤ GenVersion ≤ MaxVersion 53 | const ( 54 | _ = EnforceVersion(GenVersion - MinVersion) 55 | _ = EnforceVersion(MaxVersion - GenVersion) 56 | ) 57 | --------------------------------------------------------------------------------